-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for Tumblr signposts (#171)
These are timeline objects typically used to warn of restricted searches Center signpost elements Add margin to signpost elements Allow signposts to be cached Fallback to "" when description is unavailable Minor CSS organization improvements
- Loading branch information
Showing
10 changed files
with
110 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* This file contains the styling for various Tumblr timeline objects */ | ||
|
||
.tumblr-signpost { | ||
display: flex; | ||
flex-direction: row; | ||
align-items: center; | ||
gap: 20px; | ||
|
||
width: 350px; | ||
box-sizing: border-box; | ||
overflow: hidden; | ||
|
||
margin: 0 20px; | ||
padding: 20px 25px; | ||
|
||
background: var(--tumblr-signpost-bg); | ||
color: var(--color-text); | ||
border: 2px solid var(--tumblr-signpost-border); | ||
border-radius: 10px; | ||
|
||
box-shadow: rgba(0,0,0,0.2) 0px 1px 3px; | ||
} | ||
|
||
.tumblr-signpost svg { | ||
min-width: max-content; | ||
} | ||
|
||
.tumblr-signpost p { | ||
line-height: 2; | ||
font-size: 12px; | ||
} | ||
|
||
.tumblr-signpost h3 { | ||
font-weight: bold; | ||
margin: 0; | ||
margin-bottom: 10px; | ||
font-size: 14px; | ||
} | ||
|
||
|
||
@media (max-width: 350px) { | ||
.tumblr-signpost { | ||
width: auto; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from . import base, blog, post, timelines | ||
from . import base, blog, post, timelines, misc | ||
|
||
from .base import VERSION |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from typing import NamedTuple, Optional | ||
|
||
class Signpost(NamedTuple): | ||
title: str | ||
description: Optional[str] = None | ||
|
||
def to_json_serialisable(self): | ||
return { | ||
"title": self.title, | ||
"description": self.description | ||
} | ||
|
||
@classmethod | ||
def from_json(cls, json): | ||
return cls(**json) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<figure class="tumblr-signpost"> | ||
<svg class="icon" xmlns="http://www.w3.org/2000/svg" height="48px" width="48px" viewBox="0 -960 960 960"><path d="M451.5-85v-185H234L125-379l109-108.5h217.5v-90H165V-795h286.5v-80H509v80h217.5L835-686.5l-108.5 109H509v90h286V-270H509v185h-57.5Zm-229-550h480l51-51.5-51-51h-480V-635ZM258-327.5h479.5V-430H258l-51.5 51 51.5 51.5ZM222.5-635v-102.5V-635Zm515 307.5V-430v102.5Z"/></svg> | ||
<div> | ||
<h3>{{element.title}}</h3> | ||
<p>{{element.description or ""}}</p> | ||
</div> | ||
</figure> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters