refactor: make timeline-style opt-in instead of opt-out

To opt-in, add .timeline class alongside ul.posts
main
Julian Lam 4 years ago
parent 3e245c8593
commit 1e52533297

@ -48,8 +48,8 @@
white-space: nowrap; white-space: nowrap;
} }
.timeline { .timeline-style {
.posts > [component="post"], .timeline-event { > [component="post"], .timeline-event {
position: relative; // for absolutely positioned pseudo-element, below position: relative; // for absolutely positioned pseudo-element, below
border-left: 2px solid lighten(@brand-primary, 30%); border-left: 2px solid lighten(@brand-primary, 30%);
margin-left: 2.5rem; margin-left: 2.5rem;
@ -74,7 +74,7 @@
} }
@media (max-width: @screen-sm-max) { @media (max-width: @screen-sm-max) {
.posts > [component="post"] { [component="post"] {
border: 0; border: 0;
padding: @post-padding 0; padding: @post-padding 0;
@ -84,7 +84,7 @@
} }
} }
.posts [component="post"]:last-child:after { [component="post"]:last-child:after {
display: none; display: none;
} }
@ -114,7 +114,7 @@
border-left-style: dashed; border-left-style: dashed;
} }
.posts [component="post"]:last-child:after { [component="post"]:last-child:after {
content: ''; content: '';
width: 1rem; width: 1rem;
position: absolute; position: absolute;
@ -123,7 +123,7 @@
border-bottom: 2px solid lighten(@brand-primary, 30%); border-bottom: 2px solid lighten(@brand-primary, 30%);
} }
.posts .timeline-event { [component="topic/event"].timeline-event {
text-align: left; text-align: left;
justify-content: left; justify-content: left;
font-size: 1em; font-size: 1em;

@ -412,8 +412,6 @@
.topic { .topic {
.timeline;
&.deleted { &.deleted {
.opacity(0.3); .opacity(0.3);
@ -423,6 +421,10 @@
} }
.posts { .posts {
&.timeline {
.timeline-style;
}
list-style-type: none; list-style-type: none;
padding: 0; padding: 0;

@ -57,7 +57,7 @@
<!-- IMPORT partials/topic/deleted-message.tpl --> <!-- IMPORT partials/topic/deleted-message.tpl -->
{{{ end }}} {{{ end }}}
<ul component="topic" class="posts" data-tid="{tid}" data-cid="{cid}"> <ul component="topic" class="posts timeline" data-tid="{tid}" data-cid="{cid}">
{{{each posts}}} {{{each posts}}}
<li component="post" class="{{{ if posts.deleted }}}deleted{{{ end }}} {{{ if posts.selfPost }}}self-post{{{ end }}} {{{ if posts.topicOwnerPost }}}topic-owner-post{{{ end }}}" <!-- IMPORT partials/data/topic.tpl -->> <li component="post" class="{{{ if posts.deleted }}}deleted{{{ end }}} {{{ if posts.selfPost }}}self-post{{{ end }}} {{{ if posts.topicOwnerPost }}}topic-owner-post{{{ end }}}" <!-- IMPORT partials/data/topic.tpl -->>
<a component="post/anchor" data-index="{posts.index}" id="{posts.index}"></a> <a component="post/anchor" data-index="{posts.index}" id="{posts.index}"></a>

Loading…
Cancel
Save