mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 07:38:01 +08:00
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:
parent
0c56a20788
commit
f57d49ed01
|
@ -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"))
|
||||
);
|
||||
},
|
||||
});
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
.topic-post-visited-line {
|
||||
.topic-post-visited {
|
||||
+ .topic-post article {
|
||||
border-top: none;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user