UX: Layout issues with topic last visit line. (#13655)

Remove the calculation of width and instead switch to small action class
that automatically sets the width based on the screen size.
This commit is contained in:
Alan Guo Xiang Tan 2021-07-07 12:40:40 +08:00 committed by GitHub
parent 0c56a20788
commit f57d49ed01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 34 deletions

View File

@ -3,16 +3,12 @@ import { createWidget } from "discourse/widgets/widget";
import { h } from "virtual-dom";
export default createWidget("topic-post-visited-line", {
tagName: "div.topic-post-visited-line",
tagName: "div.small-action.topic-post-visited",
buildClasses(attrs) {
return [`post-${attrs.post_number}`];
},
html() {
html(attrs) {
return h(
"span.topic-post-visited-message",
I18n.t("topics.new_messages_marker")
`div.topic-post-visited-line.post-${attrs.post_number}}`,
h("span.topic-post-visited-message", I18n.t("topics.new_messages_marker"))
);
},
});

View File

@ -911,6 +911,29 @@ blockquote > *:last-child {
order: 8;
}
}
&.topic-post-visited {
border-top: none;
+ .small-action {
border-top: none;
}
.topic-post-visited-line {
text-align: center;
border-bottom: 1px solid var(--danger-medium);
line-height: 0.1em;
margin: 1rem 0px;
width: 100%;
.topic-post-visited-message {
background-color: var(--secondary);
color: var(--danger-medium);
font-size: $font-down-1;
padding: 0 8px;
}
}
}
}
.whisper {
@ -1030,25 +1053,6 @@ a.mention-group {
}
}
.topic-post-visited-line {
border-bottom: 1px solid var(--danger-medium);
line-height: 0.1em;
text-align: center;
margin: 1rem 0px;
.topic-post-visited-message {
position: relative; // Chrome needs this, otherwise the line is above the text
background-color: var(--secondary);
color: var(--danger-medium);
font-size: $font-down-1;
padding: 0 8px;
}
+ .small-action {
border-top: none;
}
}
// Select posts
.topic-post {

View File

@ -577,12 +577,7 @@ blockquote {
}
}
.topic-post-visited-line {
width: calc(
#{$topic-body-width} + #{$topic-avatar-width} +
(#{$topic-body-width-padding} * 2)
);
.topic-post-visited {
+ .topic-post {
.topic-avatar,
.topic-body {

View File

@ -9,7 +9,7 @@
}
}
.topic-post-visited-line {
.topic-post-visited {
+ .topic-post article {
border-top: none;
}