Skip to content

A platform for community discussion. Free, open, simple.

UX: hide topic list views and posters less agressively on small screens (#35852)

Kris0c58496ac34d
diff --git a/app/assets/stylesheets/desktop/topic-list.scss b/app/assets/stylesheets/desktop/topic-list.scss
index 51d985d64f6..5c8815bc618 100644
--- a/app/assets/stylesheets/desktop/topic-list.scss
+++ b/app/assets/stylesheets/desktop/topic-list.scss
@@ -1,5 +1,27 @@
@use "lib/viewport";
+@mixin hide-posters {
+ width: 2em;
+ text-align: center;
+
+ a:first-child .avatar.latest:not(.single) {
+ top: 0;
+ left: 0;
+ }
+
+ a:not(.latest) {
+ display: none;
+ }
+
+ a.latest {
+ width: 100%;
+
+ img {
+ margin: 0 auto;
+ }
+ }
+}
+
// --------------------------------------------------
// Topic lists
// --------------------------------------------------
@@ -105,6 +127,16 @@
font-size: var(--font-down-1);
}
}
+
+ @include viewport.until(md) {
+ @include hide-posters;
+ }
+
+ @include viewport.until(lg) {
+ .has-sidebar-page & {
+ @include hide-posters;
+ }
+ }
}
td.topic-list-data.posters {
@@ -124,6 +156,16 @@
.views {
width: var(--d-topic-list-likes-views-posts-width);
+
+ @include viewport.until(md) {
+ display: none;
+ }
+
+ .has-sidebar-page & {
+ @include viewport.until(lg) {
+ display: none;
+ }
+ }
}
.posts {
@@ -222,40 +264,10 @@
/* stylelint-disable-next-line discourse/no-breakpoint-mixin */
@include breakpoint(medium, $sidebar: true) {
.topic-list {
- // suppress views column
- .views {
- display: none;
- }
-
// reduce width for more title space
.posts {
width: 3em;
}
-
- .posters {
- width: 2em;
- text-align: center;
- }
-
- // show only the first poster
- .topic-list-data.posters {
- a:first-child .avatar.latest:not(.single) {
- top: 0;
- left: 0;
- }
-
- a:not(.latest) {
- display: none;
- }
-
- a.latest {
- width: 100%;
-
- img {
- margin: 0 auto;
- }
- }
- }
}
}