UX: Styling embedded post collapse button

This commit is contained in:
Kris 2018-01-16 15:48:47 -05:00
parent 6fff16a999
commit dc5b0e05e2
4 changed files with 46 additions and 10 deletions

View File

@ -300,14 +300,15 @@ createWidget('post-contents', {
const repliesBelow = state.repliesBelow; const repliesBelow = state.repliesBelow;
if (repliesBelow.length) { if (repliesBelow.length) {
result.push(h('section.embedded-posts.bottom', [ result.push(h('section.embedded-posts.bottom', [
repliesBelow.map(p => {
return this.attach('embedded-post', p, { model: this.store.createRecord('post', p) });
}),
this.attach('button', { this.attach('button', {
title: 'post.collapse', title: 'post.collapse',
icon: 'chevron-up', icon: 'chevron-up',
action: 'toggleRepliesBelow', action: 'toggleRepliesBelow',
className: 'btn collapse-up' className: 'btn collapse-up'
}),
repliesBelow.map(p => {
return this.attach('embedded-post', p, { model: this.store.createRecord('post', p) });
}) })
])); ]));
} }

View File

@ -433,7 +433,7 @@ blockquote > *:last-child {
} }
.small-action-desc { .small-action-desc {
padding: 1em 1em 1.25em 1em; padding: 1em;
text-transform: uppercase; text-transform: uppercase;
font-weight: bold; font-weight: bold;
font-size: $font-down-1; font-size: $font-down-1;

View File

@ -207,7 +207,7 @@ nav.post-controls {
.topic-body { .topic-body {
box-sizing: border-box; box-sizing: border-box;
width: calc(100% - 60px); // [100% - .topic-avatar width] width: calc(100% - 70px); // [100% - .topic-avatar width]
// WARNING: overflow hide is required for quoted / embedded images // WARNING: overflow hide is required for quoted / embedded images
// which expect "normal" post width, but expansions are narrower // which expect "normal" post width, but expansions are narrower
overflow: hidden; overflow: hidden;
@ -221,10 +221,14 @@ nav.post-controls {
} }
.topic-avatar { .topic-avatar {
padding-left: 15px; padding-left: 25px;
padding-top: 15px; padding-top: 15px;
} }
.row {
border: 1px solid $primary-low;
}
// bottom means "reply expansion" below a post // bottom means "reply expansion" below a post
&.bottom { &.bottom {
&.hidden { &.hidden {
@ -233,15 +237,42 @@ nav.post-controls {
} }
} }
&.bottom { &.bottom {
.collapse-up {
position: absolute;
transform: translate(-50%, -170%);
background: $secondary;
border: 1px solid $primary-low;
padding: 6px 9px 8px;
z-index: 99; // Needs to be higher than topic-avatar
}
.row { .row {
padding-top: 7px; padding-bottom: .5em;
border-top: none;
border-bottom: none;
.topic-avatar, .topic-body {
border-top: 1px solid $primary-low;
}
} }
} }
// top means "in reply to expansion" above a post // top means "in reply to expansion" above a post
&.top { &.top {
.collapse-down {
position: absolute;
transform: translate(-50%, 55%);
background: $secondary;
border: 1px solid $primary-low;
padding: 6px 9px 8px;
z-index: 99; // Needs to be higher than topic-avatar
}
margin-left: 56px; margin-left: 56px;
width: 701px; width: 701px;
.row {
border-bottom: none;
.topic-avatar, .topic-body {
border-top: 1px solid $primary-low;
}
}
} }
&.top.topic-body { &.top.topic-body {
padding: 0; padding: 0;
@ -615,7 +646,7 @@ $topic-avatar-width: 45px;
position: relative; position: relative;
z-index: 2; z-index: 2;
border-top: 1px solid $primary-low; border-top: 1px solid $primary-low;
padding: 12px $topic-body-width-padding 15px $topic-body-width-padding; padding: 12px $topic-body-width-padding 0 $topic-body-width-padding;
} }
.topic-avatar { .topic-avatar {
@ -636,6 +667,11 @@ $topic-avatar-width: 45px;
border-top: none; border-top: none;
} }
.time-gap + .topic-post .embedded-posts.top {
border-bottom: 1px solid $primary-low;
}
.posts-wrapper { .posts-wrapper {
position: relative; position: relative;
-webkit-font-smoothing: subpixel-antialiased; -webkit-font-smoothing: subpixel-antialiased;

View File

@ -10,8 +10,7 @@
} }
.post-menu-area { .post-menu-area {
margin-bottom: 10px; margin: 20px 0;
margin-top: 20px;
} }
.edits {margin-right: 5px;} .edits {margin-right: 5px;}