Skip to content

Commit 613e78a

Browse files
committed
chore: timeline layout tweaks
1 parent 183b262 commit 613e78a

File tree

2 files changed

+14
-28
lines changed

2 files changed

+14
-28
lines changed

crates/rostra-web-ui/assets/style.css

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -486,11 +486,12 @@ img.u-userImage[loading="lazy"][src][width][height] {
486486
}
487487
}
488488

489-
/* Align post (non-replies) to where a root reply would be,
490-
to make visually parsing even easier. */
491-
.o-mainBarTimeline__item.-post>.m-postView {
492-
padding-left: 1rem;
493-
padding-top: 1rem;
489+
.o-mainBarTimeline__item {
490+
margin-top: 0.5em;
491+
}
492+
493+
.o-mainBarTimeline__item.-preview .m-postView {
494+
opacity: 0.6;
494495
}
495496

496497
.o-mainBarTimeline__item.-preview .m-postView {
@@ -513,11 +514,9 @@ img.u-userImage[loading="lazy"][src][width][height] {
513514

514515
.m-postView {
515516
max-width: 55rem;
517+
margin: 0.5em;
516518
}
517519

518-
.m-postContext__postView {
519-
margin-left: 1em;
520-
}
521520

522521
.m-postView__main {
523522
display: flex;
@@ -561,25 +560,16 @@ img.u-userImage[loading="lazy"][src][width][height] {
561560
height: 10rem;
562561
/* top: 40%; */
563562
background: linear-gradient(to bottom,
564-
rgba(59, 59, 59, 0) 0%,
565-
var(--color-timeline-bg) 60%);
563+
rgba(59, 59, 59, 0%) 20%,
564+
var(--color-timeline-bg) 70%);
566565
z-index: 1;
567566
}
568567

569568
/* By default, hide buttons on reply parents */
570-
.m-postView.-reply-parent>.m-postView__buttonBar {
569+
.m-postContext__postParent:not(.-expanded) .m-postView__buttonBar {
571570
display: none;
572571
}
573572

574-
/* When expanded, show the buttons - this class will be added via JS */
575-
.m-postView.-reply-parent.-show-buttons>.m-postView__buttonBar {
576-
display: flex;
577-
}
578-
579-
/* But if it's expanded, show the buttons */
580-
.m-postView.-reply-parent:has(>div>.m-postView__contentSide.-expanded)>.m-postView__buttonBar {
581-
display: flex;
582-
}
583573

584574
.m-postView__contentSide>* {
585575
word-wrap: break-word;

crates/rostra-web-ui/src/routes/post.rs

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -399,14 +399,10 @@ impl UiState {
399399
."-missing"[post_content_rendered.is_none()]
400400
."-present"[post_content_rendered.is_some()]
401401
{
402-
p {
403-
@if let Some(post_content_rendered) = post_content_rendered {
404-
(post_content_rendered)
405-
} @else {
406-
p {
407-
"Post missing"
408-
}
409-
}
402+
@if let Some(post_content_rendered) = post_content_rendered {
403+
(post_content_rendered)
404+
} @else {
405+
p { "Post missing" }
410406
}
411407
}
412408
}

0 commit comments

Comments
 (0)