Skip to content

Commit

Permalink
feat: Add the button of sticky-top in timeline of post
Browse files Browse the repository at this point in the history
  • Loading branch information
liuyib committed Sep 14, 2019
1 parent 118e5f2 commit 7b859df
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions layout/_mixins/post-timeline.pug
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@ mixin postTimeline(posts)
a(href=url_for(post.link) target="_blank" rel="noopener").post-timeline-item-title__a= post.title || post.link
else
a(href=url_for(post.path)).post-timeline-item-title__a= post.title || __("post.untitled")
if post.top
include ../_partials/widgets/sticky-top.pug
- })
8 changes: 7 additions & 1 deletion source/css/_common/components/post/post-timeline.styl
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@

time-width = 3em;
time-margin = 1em;
sticky-top-width = 2em;

&__time {
display: inline-block;
Expand All @@ -61,10 +62,15 @@
transform: translateY(3%);
}

.sticky-top {
width: 2em;
height: 2em;
}

&-title {
display: inline-block;
margin: 0;
width: 'calc(100% - %s)' % (time-width + time-margin);
width: 'calc(100% - %s)' % (time-width + time-margin + sticky-top-width);
font-size: 1em;
font-weight: normal;
vertical-align: middle;
Expand Down

0 comments on commit 7b859df

Please sign in to comment.