Skip to content

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

REFACTOR: consolidate mobile & desktop topic-list.scss into common (#37252)

Kris1880ad8e74df
diff --git a/app/assets/stylesheets/common/base/_topic-list.scss b/app/assets/stylesheets/common/base/_topic-list.scss
index ac791fd4d29..4e722e38d0c 100644
--- a/app/assets/stylesheets/common/base/_topic-list.scss
+++ b/app/assets/stylesheets/common/base/_topic-list.scss
@@ -45,6 +45,13 @@
font-weight: bold;
color: var(--primary);
}
+
+ @include viewport.until(sm) {
+ p {
+ font-size: var(--font-up-1);
+ margin-bottom: 0.75em;
+ }
+ }
}
.category-logo.aspect-image {
@@ -331,6 +338,20 @@
}
}
+.topic-list-bottom {
+ margin: var(--space-5) 0;
+
+ @include viewport.until(sm) {
+ margin-bottom: 0;
+ }
+
+ @include viewport.from(sm) {
+ .dismiss-container-bottom {
+ float: right;
+ }
+ }
+}
+
.heatmap-high,
.heatmap-high a,
.heatmap-high .d-icon,
@@ -384,6 +405,8 @@
.show-more {
&.has-topics {
+ @include d-animation(float-down, 250ms, ease-in-out);
+
@include viewport.from(md) {
position: absolute;
z-index: z("base");
@@ -397,8 +420,6 @@
border-radius: var(--d-border-radius-large);
}
}
-
- @include d-animation(float-down, 250ms, ease-in-out);
}
.alert {
@@ -414,6 +435,23 @@
}
}
}
+
+ @include viewport.from(sm) {
+ h2 {
+ margin: var(--space-5) 0 var(--space-3);
+ }
+
+ .top-lists {
+ h2 {
+ cursor: pointer;
+ margin: 5px 0 10px;
+ }
+
+ .period-chooser .select-kit-body {
+ width: 275px;
+ }
+ }
+ }
}
.d-icon-thumbtack.unpinned {
@@ -443,3 +481,463 @@
line-height: var(--line-height-medium);
margin-bottom: var(--space-2);
}
+
+@include viewport.from(sm) {
+ .topic-list {
+ @include topic-list-icons;
+ margin: var(--d-topic-list-margin-y) var(--d-topic-list-margin-x)
+ var(--d-topic-list-margin-bottom);
+
+ .topic-list-header {
+ font-size: var(--d-topic-list-header-font-size);
+ }
+
+ .topic-list-header .topic-list-data {
+ padding: var(--d-topic-list-header-data-padding-y)
+ var(--d-topic-list-header-data-padding-x);
+ color: var(--d-topic-list-header-text-color);
+ }
+
+ .topic-list-data {
+ padding: var(--d-topic-list-data-padding-y)
+ var(--d-topic-list-data-padding-x);
+
+ &:first-of-type {
+ padding-inline-start: var(--d-topic-list-data-padding-inline-start);
+ }
+
+ &:last-of-type {
+ padding-inline-end: var(--d-topic-list-data-padding-inline-end);
+ }
+
+ th & {
+ border-bottom: 3px solid var(--primary-low);
+ }
+ }
+
+ button.bulk-select {
+ padding: 0;
+ margin-right: var(--space-2);
+ line-height: var(--line-height-large);
+ }
+
+ .topic-list-data.bulk-select {
+ padding: 0;
+ width: 30px;
+
+ label {
+ margin: 0;
+ padding: var(--space-3) var(--space-2);
+ cursor: pointer;
+ }
+
+ + .main-link {
+ padding-left: 0;
+ }
+ }
+
+ $td-posters-height: 29px; // min-height of td with avatar glow
+ $td-posters-more-lh: $td-posters-height - 4;
+
+ .posters {
+ // we know there are up to 5 avatars of fixed size
+ // will be overridden by media width queries on narrow displays to 1 avatar's width
+ width: 146px;
+
+ img.avatar {
+ height: var(--d-topic-list-avatar-size);
+ width: var(--d-topic-list-avatar-size);
+ }
+
+ > a {
+ float: left;
+ margin-right: 4px;
+
+ &:last-of-type {
+ margin-right: 0;
+ }
+
+ &.posters-more-count {
+ cursor: default;
+ color: var(--primary-med-or-secondary-med);
+ line-height: $td-posters-more-lh;
+ 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 {
+ height: $td-posters-height;
+ }
+
+ .posters a:first-child .avatar.latest:not(.single) {
+ box-shadow: 0 0 3px 1px rgb(var(--tertiary-rgb), 0.35);
+ border: 1px solid rgb(var(--tertiary-rgb), 0.5);
+ position: relative;
+ left: -2px;
+ }
+
+ .likes {
+ width: var(--d-topic-list-likes-views-posts-width);
+ }
+
+ .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 {
+ width: var(--d-topic-list-likes-views-posts-width);
+ }
+
+ .post-actions {
+ clear: both;
+ width: auto;
+ color: var(--primary-med-or-secondary-med);
+ text-align: left;
+ font-size: var(--font-down-1);
+ margin-top: 5px;
+
+ .fa {
+ margin-right: 2px;
+ }
+
+ a {
+ color: var(--primary-med-or-secondary-med);
+ margin-right: 3px;
+ line-height: var(--line-height-large);
+ }
+ }
+
+ .activity {
+ width: 4em;
+
+ &:lang(zh_CN) {
+ width: 5.3em;
+ }
+ }
+
+ .age {
+ width: 4em;
+ }
+
+ .with-year {
+ white-space: nowrap;
+ }
+ }
+
+ .topic-replies-toggle-wrapper {
+ padding: 0 var(--nav-horizontal-padding);
+
+ .topics-replies-toggle {
+ background: none;
+ border: none;
+ line-height: var(--line-height-large);
+ padding: var(--space-2);
+ position: relative;
+ font-size: var(--font-down-1-rem);
+
+ &.active {
+ @include nav-active;
+ }
+
+ &:hover {
+ @include nav-hover;
+ }
+ }
+ }
+
+ .dismiss-container-top {
+ display: flex;
+ justify-content: flex-end;
+ }
+
+ .bulk-select-topics {
+ display: inline-flex;
+ margin-left: -5px;
+
+ .btn {
+ margin-right: var(--space-2);
+ }
+ }
+}
+
+@include viewport.between(sm, lg) {
+ .topic-list {
+ .topic-list-data {
+ font-size: var(--font-0);
+ }
+ }
+
+ .topic-list-header {
+ font-size: var(--font-down-1);
+ }
+
+ .container.list-container {
+ position: relative;
+ padding: 0 var(--list-container-padding-x);
+ }
+
+ .container.list-container.--categories {
+ padding: 0 var(--list-container-categories-padding-x);
+ }
+
+ .container.list-container.--topic-list {
+ padding: 0 var(--list-container-topiclist-padding-x);
+ }
+}
+
+@include viewport.until(sm) {
+ .fade.in {
+ opacity: 1;
+ }
+
+ .list-container .full-width {
+ margin-left: 0;
+ }
+
+ td .main-link {
+ width: 78%;
+ display: inline-block;
+ }
+
+ .topic-list {
+ &-body {
+ border-width: 1px;
+
+ body:has(.topic-replies-toggle-wrapper) & {
+ border-width: 0;
+ }
+ }
+
+ .num.posts-map {
+ font-size: var(--font-up-2);
+ padding: 0;
+
+ > button,
+ > a {
+ padding: 0;
+ }
+ }
+
+ .num.activity a {
+ padding: 0;
+ }
+
+ // so the topic excerpt is full width
+ // as the containing div is 80%
+ .topic-excerpt {
+ display: block;
+ padding-right: 0;
+ width: 120%;
+ }
+
+ .topic-excerpt-more {
+ color: var(--tertiary);
+ }
+
+ .right {
+ margin-left: 55px;
+ }
+
+ .topic-list-data {
+ padding: 7px 0;
+ max-width: 300px;
+ }
+
+ .main-link {
+ line-height: var(--line-height-medium);
+ position: relative;
+ font-size: var(--font-up-1);
+
+ a.title {
+ color: var(--primary);
+ padding: 0;
+ overflow-wrap: break-word;
+ }
+
+ .topic-statuses {
+ a {
+ line-height: 0.8;
+ color: var(--primary-medium);
+ }
+ }
+ }
+
+ .badge-notification,
+ .category-topic-link td.num .badge-notification {
+ position: relative;
+ display: inline-block;
+ top: -1px;
+ font-size: var(--font-0);
+ line-height: var(--line-height-small);
+ padding: 0.15em 0.4em 0.2em 0.4em;
+
+ .d-icon {
+ color: var(--secondary);
+ }
+
+ &.new-topic::before {
+ margin-right: 0;
+ }
+
+ &.new-topic {
+ padding: 0;
+ }
+ }
+
+ .category-topic-link td.num .badge-notification {
+ &.unread-posts {
+ color: var(--secondary);
+ }
+ }
+
+ .topic-item-stats {
+ position: relative;
+ display: flex;
+ align-items: baseline;
+ margin-top: 0.5em;
+ z-index: z("base");
+
+ span.relative-date {
+ vertical-align: text-top;
+ }
+
+ .num.activity {
+ margin-left: auto;
+ font-size: var(--font-down-1);
+ }
+
+ .category a {
+ max-width: 160px;
+ }
+
+ .num .d-icon {
+ color: var(--primary-medium);
+ }
+ }
+
+ .topic-item-stats__category-tags {
+ margin-right: 0.5em;
+ max-width: 90%;
+ line-height: var(--line-height-medium);
+
+ .badge-category__wrapper {
+ vertical-align: bottom;
+ margin-right: 0.5em;
+ max-width: 100%;
+ }
+
+ .badge-wrapper,
+ .discourse-tag {
+ // disabling clicks because these targets are too small on mobile
+ pointer-events: none;
+ }
+
+ .discourse-tags {
+ display: inline;
+
+ &__tag-separator {
+ position: absolute;
+ display: inline-block;
+ vertical-align: middle;
+ margin-left: -0.5em;
+ margin-top: 0.25em;
+ }
+
+ .discourse-tag {
+ margin: 0 0.5em 0 0;
+ }
+ }
+
+ .badge-wrapper {
+ max-width: 100%;
+ vertical-align: bottom;
+ }
+ }
+
+ .age {
+ white-space: nowrap;
+
+ a {
+ color: var(--primary-medium);
+ }
+ }
+ }
+
+ .dropdown-toggle:active,
+ .open .dropdown-toggle {
+ outline: 0;
+ }
+
+ .topic-list-header {
+ display: none;
+ }
+
+ .topic-list.sticky-header {
+ .topic-list-header {
+ display: table-header-group;
+ position: sticky;
+ z-index: z("base") + 2;
+ top: var(--header-offset);
+ background: var(--secondary);
+
+ tr {
+ display: flex;
+ align-items: center;
+ border: none;
+ }
+
+ .topic-list-data {
+ display: none;
+
+ &.bulk-select {
+ display: inline-block;
+ }
+
+ &.default {
+ display: flex;
+
+ .bulk-select-topic-dropdown__count {
+ display: none;
+ }
+ }
+ }
+
+ button.bulk-select {
+ padding-left: 0.85em; // visual alignment
+ }
+ }
+ }
+
+ .bulk-select-topics {
+ display: flex;
+ flex-wrap: wrap;
+ padding-left: 0.85em;
+ gap: 0.5em;
+ font-size: var(--font-down-1);
+
+ .select-kit-collection {
+ font-size: var(--font-up-1);
+ }
+ }
+}
diff --git a/app/assets/stylesheets/common/base/category-list.scss b/app/assets/stylesheets/common/base/category-list.scss
index fd1ca464aaf..a94446449e6 100644
--- a/app/assets/stylesheets/common/base/category-list.scss
+++ b/app/assets/stylesheets/common/base/category-list.scss
@@ -1,3 +1,5 @@
+@use "lib/viewport";
+
.category-list {
table-layout: fixed;
@@ -188,6 +190,10 @@
text-align: var(--category-boxes-text-alignment);
color: var(--primary);
overflow: hidden;
+
+ @include viewport.until(sm) {
+ margin: 0 0 0.5em 0;
+ }
}
h4 a {
@@ -343,20 +349,54 @@
}
}
-.categories-list .category {
- h3,
- h4 {
- margin-bottom: var(--d-categories-list-title-margin-bottom);
- }
+.categories-list {
+ .category {
+ h3,
+ h4 {
+ margin-bottom: var(--d-categories-list-title-margin-bottom);
+ }
- .category-description {
- margin-top: 0.5em;
- overflow: hidden;
- color: var(--primary-high);
+ .category-description {
+ margin-top: 0.5em;
+ overflow: hidden;
+ color: var(--primary-high);
+ }
+
+ .category-logo.aspect-image {
+ margin-top: 0.5em;
+ }
}
- .category-logo.aspect-image {
- margin-top: 0.5em;
+ @include viewport.until(sm) {
+ .category-list {
+ margin-bottom: 2em;
+
+ td {
+ padding: 12px 5px;
+ color: var(--primary-med-or-secondary-high);
+ vertical-align: top;
+ }
+
+ th {
+ padding: 10px 0 0;
+ }
+
+ td:first-of-type {
+ padding-left: 10px;
+ }
+
+ tbody {
+ border-top: none;
+
+ .category {
+ border-left: 6px solid;
+ }
+ }
+
+ &.with-topics .category-list-item .category-description {
+ display: none;
+ }
+ }
}
}
@@ -400,6 +440,10 @@
border-right: none 0;
margin-left: -3px;
+ @include viewport.until(sm) {
+ margin-left: 0;
+ }
+
.d-icon {
color: var(--primary-medium);
margin-top: 0.25em;
@@ -422,3 +466,188 @@
margin-bottom: 0;
}
}
+
+@include viewport.until(sm) {
+ .category-list .category.muted a.category-title-link {
+ color: var(--primary-medium);
+ font-size: var(--font-down-1);
+ }
+
+ .category-list-item.category {
+ // Allow percentage widths on table cells to include their padding
+ box-sizing: border-box;
+
+ tr:first-of-type {
+ border: none;
+ }
+
+ *,
+ *::before,
+ *::after {
+ box-sizing: inherit;
+ }
+
+ .posts {
+ vertical-align: top;
+ }
+
+ .age {
+ margin-left: 5px;
+ }
+
+ // numbers get dimmer as they get colder
+ .coldmap {
+ &-high {
+ opacity: 0.4;
+ }
+
+ &-med {
+ opacity: 0.6;
+ }
+
+ &-low {
+ opacity: 0.8;
+ }
+ }
+ }
+
+ .category-logo.aspect-image {
+ display: block;
+ margin: 1.5em 0 1em;
+ }
+
+ .subcategory-list-item.category {
+ display: block;
+ width: calc(100% + 20px);
+ margin: 1.25em 10px 0;
+ border-bottom: none !important;
+ border-top: 1px solid var(--content-border-color) !important;
+
+ &:last-of-type {
+ margin-top: 0;
+ margin-bottom: 1.25em;
+ border-bottom: 1px solid var(--content-border-color) !important;
+ }
+
+ td:first-of-type {
+ padding: 12px 0;
+ }
+
+ .category-logo.aspect-image {
+ display: none;
+ }
+
+ .subcategories {
+ padding-left: 10px;
+ }
+ }
+
+ tr.category-topic-link {
+ border-bottom: 1px solid var(--content-border-color);
+
+ &:last-of-type {
+ border-bottom: none;
+ }
+ }
+
+ .category-list-item,
+ .subcategory-list-item {
+ padding: 0 0 0 3px;
+ border-left: 6px solid;
+
+ h3,
+ h4 {
+ max-width: 100%;
+ padding: 0 0 0 10px;
+
+ .d-icon {
+ margin-right: 5px;
+ }
+
+ a[href] {
+ color: var(--primary);
+ }
+ }
+
+ h3 {
+ font-size: var(--font-up-2);
+ }
+
+ h4 {
+ font-size: var(--font-up-1);
+ }
+
+ .category-name {
+ max-width: 80vw;
+ }
+
+ .category-topic-link .main-link,
+ .subcategories-list td,
+ .category-description td {
+ padding-left: 10px;
+ }
+
+ .category-topic-link .main-link .age {
+ font-size: var(--font-down-1);
+ }
+
+ .category-description td {
+ padding-top: 0;
+ padding-bottom: 15px;
+ }
+
+ .subcategories-list {
+ border-bottom: none;
+
+ td {
+ padding-top: 15px;
+ }
+ }
+
+ .category-topic-link {
+ .num {
+ white-space: nowrap;
+ }
+
+ .topic-excerpt {
+ width: 110%;
+ }
+ }
+
+ .posters {
+ float: left;
+ }
+
+ > footer {
+ border-top: 1px solid var(--content-border-color);
+ padding: 7px 10px;
+
+ .category-stat {
+ float: left;
+ margin: 3px 1em 0 0;
+ font-weight: normal;
+ font-size: var(--font-down-1);
+
+ .value {
+ font-weight: bold;
+ }
+ }
+
+ .btn {
+ float: right;
+ margin-left: 7px;
+ }
+ }
+ }
+
+ .category-list-item {
+ padding: 0.5em 0 0.25em;
+ border-top: 1px solid var(--content-border-color) !important;
+ border-bottom: 1px solid var(--content-border-color) !important;
+ margin: 1em 0 2em;
+ }
+
+ .category-topics-count a {
+ color: var(--primary);
+ }
+}
diff --git a/app/assets/stylesheets/common/base/discourse.scss b/app/assets/stylesheets/common/base/discourse.scss
index 9099a7ac61f..442fd2da2f9 100644
--- a/app/assets/stylesheets/common/base/discourse.scss
+++ b/app/assets/stylesheets/common/base/discourse.scss
@@ -581,6 +581,11 @@ textarea {
margin-left: 0.67em;
}
+.dropdown,
+.multiselect {
+ position: relative;
+}
+
.container {
@extend .clearfix;
}
diff --git a/app/assets/stylesheets/common/base/list-controls.scss b/app/assets/stylesheets/common/base/list-controls.scss
index c6cf4a99c95..e267f89ef68 100644
--- a/app/assets/stylesheets/common/base/list-controls.scss
+++ b/app/assets/stylesheets/common/base/list-controls.scss
@@ -93,6 +93,14 @@
margin-right: 0.5em;
margin-bottom: 0;
}
+
+ @include viewport.from(sm) {
+ // only target the top-level li, not dropdowns
+ .select-kit {
+ align-self: stretch;
+ height: 100%;
+ }
+ }
}
.mobile-view {
diff --git a/app/assets/stylesheets/common/components/navs.scss b/app/assets/stylesheets/common/components/navs.scss
index 88d2eac08b0..0766a322bfe 100644
--- a/app/assets/stylesheets/common/components/navs.scss
+++ b/app/assets/stylesheets/common/components/navs.scss
@@ -1,3 +1,5 @@
+@use "lib/viewport";
+
// --------------------------------------------------
// Navigation menus
// --------------------------------------------------
@@ -42,6 +44,11 @@
transition: var(--d-button-transition);
white-space: nowrap;
+ @include viewport.between(sm, lg) {
+ font-size: var(--font-0);
+ padding: var(--space-2) var(--space-3);
+ }
+
.d-icon {
margin-right: 5px;
color: var(--primary-high);
diff --git a/app/assets/stylesheets/common/foundation/mixins.scss b/app/assets/stylesheets/common/foundation/mixins.scss
index 5b0436acfab..b000e9e4b79 100644
--- a/app/assets/stylesheets/common/foundation/mixins.scss
+++ b/app/assets/stylesheets/common/foundation/mixins.scss
@@ -41,7 +41,7 @@ $breakpoints: (
@if $sidebar {
// when the sidebar is shown, we want to increase the breakpoints by the width of the sidebar
/* stylelint-disable-next-line scss/no-global-function-names */
- @media #{$type} and (#{$rule}: calc(#{map-get($breakpoints, $bp)} + #{$d-sidebar-width})) {
+ @media #{$type} and (#{$rule}: calc(#{map-get($breakpoints, $bp)} + #{$sidebar-width})) {
.has-sidebar-page {
@content;
}
@@ -321,3 +321,43 @@ $hpad: 0.65em;
display: inline-block;
margin: 0.15em;
}
+
+@mixin topic-list-icons {
+ .d-icon-thumbtack {
+ color: var(--primary-med-or-secondary-med);
+ }
+
+ .d-icon-thumbtack.unpinned {
+ color: var(--primary-med-or-secondary-med);
+ }
+
+ a.title {
+ color: var(--primary);
+ }
+
+ .d-icon-bookmark {
+ color: var(--primary-med-or-secondary-med);
+ }
+}
+
+@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;
+ }
+ }
+}
diff --git a/app/assets/stylesheets/desktop/_index.scss b/app/assets/stylesheets/desktop/_index.scss
index b6f457f83a8..9dc82f107b7 100644
--- a/app/assets/stylesheets/desktop/_index.scss
+++ b/app/assets/stylesheets/desktop/_index.scss
@@ -1,5 +1,4 @@
@import "category-list";
@import "latest-topic-list";
@import "topic";
-@import "topic-list";
@import "topic-post";
diff --git a/app/assets/stylesheets/desktop/latest-topic-list.scss b/app/assets/stylesheets/desktop/latest-topic-list.scss
index 512b714d687..f750f7b5cab 100644
--- a/app/assets/stylesheets/desktop/latest-topic-list.scss
+++ b/app/assets/stylesheets/desktop/latest-topic-list.scss
@@ -1,6 +1,8 @@
+@use "common/foundation/mixins";
+
.latest-topic-list,
.top-topic-list {
- @extend .topic-list-icons;
+ @include mixins.topic-list-icons;
.table-heading {
padding: 12px 5px;
diff --git a/app/assets/stylesheets/desktop/topic-list.scss b/app/assets/stylesheets/desktop/topic-list.scss
deleted file mode 100644
index 3ae36f8e0c6..00000000000
--- a/app/assets/stylesheets/desktop/topic-list.scss
+++ /dev/null
@@ -1,325 +0,0 @@
-@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
-// --------------------------------------------------
-
-// Base list
-// --------------------------------------------------
-.topic-list-icons {
- .d-icon-thumbtack {
- color: var(--primary-med-or-secondary-med);
- }
-
- .d-icon-thumbtack.unpinned {
- color: var(--primary-med-or-secondary-med);
- }
-
- a.title {
- color: var(--primary);
- }
-
- .d-icon-bookmark {
- color: var(--primary-med-or-secondary-med);
- }
-}
-
-.topic-list {
- @extend .topic-list-icons;
- margin: var(--d-topic-list-margin-y) var(--d-topic-list-margin-x)
- var(--d-topic-list-margin-bottom);
-
- .topic-list-header {
- font-size: var(--d-topic-list-header-font-size);
- }
-
- .topic-list-header .topic-list-data {
- padding: var(--d-topic-list-header-data-padding-y)
- var(--d-topic-list-header-data-padding-x);
- color: var(--d-topic-list-header-text-color);
- }
-
- .topic-list-data {
- padding: var(--d-topic-list-data-padding-y)
- var(--d-topic-list-data-padding-x);
-
- &:first-of-type {
- padding-inline-start: var(--d-topic-list-data-padding-inline-start);
- }
-
- &:last-of-type {
- padding-inline-end: var(--d-topic-list-data-padding-inline-end);
- }
-
- th & {
- border-bottom: 3px solid var(--primary-low);
- }
- }
-
- button.bulk-select {
- padding: 0;
- margin-right: var(--space-2);
- line-height: var(--line-height-large);
- }
-
- .topic-list-data.bulk-select {
- padding: 0;
- width: 30px;
-
- label {
- margin: 0;
- padding: var(--space-3) var(--space-2);
- cursor: pointer;
- }
-
- + .main-link {
- padding-left: 0;
- }
- }
-
- $td-posters-height: 29px; // min-height of td with avatar glow
- $td-posters-more-lh: $td-posters-height - 4;
-
- .posters {
- // we know there are up to 5 avatars of fixed size
- // will be overridden by media width queries on narrow displays to 1 avatar's width
- width: 146px;
-
- img.avatar {
- height: var(--d-topic-list-avatar-size);
- width: var(--d-topic-list-avatar-size);
- }
-
- > a {
- float: left;
- margin-right: 4px;
-
- &:last-of-type {
- margin-right: 0;
- }
-
- &.posters-more-count {
- cursor: default;
- color: var(--primary-med-or-secondary-med);
- line-height: $td-posters-more-lh;
- 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 {
- height: $td-posters-height;
- }
-
- .posters a:first-child .avatar.latest:not(.single) {
- box-shadow: 0 0 3px 1px rgb(var(--tertiary-rgb), 0.35);
- border: 1px solid rgb(var(--tertiary-rgb), 0.5);
- position: relative;
- left: -2px;
- }
-
- .likes {
- width: var(--d-topic-list-likes-views-posts-width);
- }
-
- .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 {
- width: var(--d-topic-list-likes-views-posts-width);
- }
-
- .post-actions {
- clear: both;
- width: auto;
- color: var(--primary-med-or-secondary-med);
- text-align: left;
- font-size: var(--font-down-1);
- margin-top: 5px;
-
- .fa {
- margin-right: 2px;
- }
-
- a {
- color: var(--primary-med-or-secondary-med);
- margin-right: 3px;
- line-height: var(--line-height-large);
- }
- }
-
- .activity {
- width: 4em;
-
- &:lang(zh_CN) {
- width: 5.3em;
- }
- }
-
- .age {
- width: 4em;
- }
-
- .with-year {
- white-space: nowrap;
- }
-}
-
-.topic-list-bottom {
- margin: var(--space-5) 0;
-
- .dismiss-container-bottom {
- float: right;
- }
-}
-
-// Misc. stuff
-// --------------------------------------------------
-#list-area .top-lists {
- h2 {
- cursor: pointer;
- margin: 5px 0 10px;
- }
-
- .period-chooser .select-kit-body {
- width: 275px;
- }
-}
-
-#list-area {
- h2 {
- margin: var(--space-5) 0 var(--space-3);
- }
-}
-
-.bulk-select-topics {
- display: inline-flex;
- margin-left: -5px;
-
- .btn {
- margin-right: var(--space-2);
- }
-}
-
-.dismiss-container-top {
- display: flex;
- justify-content: flex-end;
-}
-
-.category-breadcrumb {
- // only target the top-level li, not dropdowns
- .select-kit {
- align-self: stretch;
- height: 100%;
- }
-}
-
-/* Tablet (portrait) ----------- */
-
-// These styles kick in a little earlier when the sidebar appears
-
-/* stylelint-disable-next-line discourse/no-breakpoint-mixin */
-@include breakpoint(medium, $sidebar: true) {
- .topic-list {
- // reduce width for more title space
- .posts {
- width: 3em;
- }
- }
-}
-
-.topic-replies-toggle-wrapper {
- padding: 0 var(--nav-horizontal-padding);
-
- .topics-replies-toggle {
- background: none;
- border: none;
- line-height: var(--line-height-large);
- padding: var(--space-2);
- position: relative;
- font-size: var(--font-down-1-rem);
-
- &.active {
- @include nav-active;
- }
-
- &:hover {
- @include nav-hover;
- }
- }
-}
-
-@include viewport.until(lg) {
- .nav-pills {
- > li > a {
- font-size: var(--font-0);
- padding: var(--space-2) var(--space-3);
- }
- }
-
- .topic-list {
- .topic-list-data {
- font-size: var(--font-0);
- }
- }
-
- .topic-list-header {
- font-size: var(--font-down-1);
- }
-}
-
-.container.list-container {
- position: relative;
- padding: 0 var(--list-container-padding-x);
-}
-
-.container.list-container.--categories {
- padding: 0 var(--list-container-categories-padding-x);
-}
-
-.container.list-container.--topic-list {
- padding: 0 var(--list-container-topiclist-padding-x);
-}
diff --git a/app/assets/stylesheets/desktop/topic-post.scss b/app/assets/stylesheets/desktop/topic-post.scss
index 4cc8b5df84c..4be9b53921d 100644
--- a/app/assets/stylesheets/desktop/topic-post.scss
+++ b/app/assets/stylesheets/desktop/topic-post.scss
@@ -542,11 +542,6 @@ video {
-webkit-font-smoothing: subpixel-antialiased;
}
-.dropdown,
-.multiselect {
- position: relative;
-}
-
.caret {
display: inline-block;
width: 0;
diff --git a/app/assets/stylesheets/mobile/_index.scss b/app/assets/stylesheets/mobile/_index.scss
index fa291eeabfd..22a6099a736 100644
--- a/app/assets/stylesheets/mobile/_index.scss
+++ b/app/assets/stylesheets/mobile/_index.scss
@@ -1,3 +1,2 @@
@import "push-notifications-mobile";
-@import "topic-list";
@import "topic-post";
diff --git a/app/assets/stylesheets/mobile/topic-list.scss b/app/assets/stylesheets/mobile/topic-list.scss
deleted file mode 100644
index 8eb1c2a8175..00000000000
--- a/app/assets/stylesheets/mobile/topic-list.scss
+++ /dev/null
@@ -1,523 +0,0 @@
-// --------------------------------------------------
-// Topic lists
-// --------------------------------------------------
-.list-container .full-width {
- margin-left: 0;
-}
-
-.topic-list {
- &-body {
- border-width: 1px;
-
- body:has(.topic-replies-toggle-wrapper) & {
- border-width: 0;
- }
- }
-
- .num.posts-map {
- font-size: var(--font-up-2);
- padding: 0;
-
- > button,
- > a {
- padding: 0;
- }
- }
-
- .num.activity a {
- padding: 0;
- }
-
- // so the topic excerpt is full width
- // as the containing div is 80%
- .topic-excerpt {
- display: block;
- padding-right: 0;
- width: 120%;
- }
-
- .topic-excerpt-more {
- color: var(--tertiary);
- }
-
- .right {
- margin-left: 55px;
- }
-
- .topic-list-data {
- padding: 7px 0;
- max-width: 300px;
- }
-
- .main-link {
- line-height: var(--line-height-medium);
- position: relative;
- font-size: var(--font-up-1);
-
- a.title {
- color: var(--primary);
- padding: 0;
- }
-
- .topic-statuses {
- a {
- line-height: 0.8;
- color: var(--primary-medium);
- }
- }
- }
-
- .badge-notification,
- .category-topic-link td.num .badge-notification {
- position: relative;
- display: inline-block;
- top: -1px;
- font-size: var(--font-0);
- line-height: var(--line-height-small);
- padding: 0.15em 0.4em 0.2em 0.4em;
-
- .d-icon {
- color: var(--secondary);
- }
-
- &.new-topic::before {
- margin-right: 0;
- }
-
- &.new-topic {
- padding: 0;
- }
- }
-
- .category-topic-link td.num .badge-notification {
- &.unread-posts {
- color: var(--secondary);
- }
- }
-
- .topic-item-stats {
- position: relative;
- display: flex;
- align-items: baseline;
- margin-top: 0.5em;
- z-index: z("base");
-
- span.relative-date {
- vertical-align: text-top;
- }
-
- .num.activity {
- margin-left: auto;
- font-size: var(--font-down-1);
- }
-
- .category a {
- max-width: 160px;
- }
-
- .num .d-icon {
- color: var(--primary-medium);
- }
- }
-
- .topic-item-stats__category-tags {
- margin-right: 0.5em;
- max-width: 90%;
- line-height: var(--line-height-medium);
-
- .badge-category__wrapper {
- vertical-align: bottom;
- margin-right: 0.5em;
- max-width: 100%;
- }
-
- .badge-wrapper,
- .discourse-tag {
- // disabling clicks because these targets are too small on mobile
- pointer-events: none;
- }
-
- .discourse-tags {
- display: inline;
-
- &__tag-separator {
- position: absolute;
- display: inline-block;
- vertical-align: middle;
- margin-left: -0.5em;
- margin-top: 0.25em;
- }
-
- .discourse-tag {
- margin: 0 0.5em 0 0;
- }
- }
-
- .badge-wrapper {
- max-width: 100%;
- vertical-align: bottom;
- }
- }
-
- .age {
- white-space: nowrap;
-
- a {
- color: var(--primary-medium);
- }
- }
-}
-
-// Category list
-// --------------------------------------------------
-.categories-list .category-list {
- margin-bottom: 2em;
-
- td {
- padding: 12px 5px;
- color: var(--primary-med-or-secondary-high);
- vertical-align: top;
- }
-
- th {
- padding: 10px 0 0;
- }
-
- td:first-of-type {
- padding-left: 10px;
- }
-
- tbody {
- border-top: none;
-
- .category {
- border-left: 6px solid;
- }
- }
-}
-
-.category-list-item.category {
- tr:first-of-type {
- border: none;
- }
-
- // Allow percentage widths on table cells to include their padding
- box-sizing: border-box;
-
- *,
- *::before,
- *::after {
- box-sizing: inherit;
- }
-
- .posts {
- vertical-align: top;
- }
-
- .age {
- margin-left: 5px;
- }
-
- // numbers get dimmer as they get colder
- .coldmap {
- &-high {
- opacity: 0.4;
- }
-
- &-med {
- opacity: 0.6;
- }
-
- &-low {
- opacity: 0.8;
- }
- }
-}
-
-.subcategory-list-item.category {
- display: block;
- width: calc(100% + 20px);
- margin: 1.25em 10px 0;
- border-bottom: none !important;
- border-top: 1px solid var(--content-border-color) !important;
-
- &:last-of-type {
- margin-top: 0;
- margin-bottom: 1.25em;
- border-bottom: 1px solid var(--content-border-color) !important;
- }
-
- td:first-of-type {
- padding: 12px 0;
- }
-
- .category-logo.aspect-image {
- display: none;
- }
-
- .subcategories {
- padding-left: 10px;
- }
-}
-
-tr.category-topic-link {
- border-bottom: 1px solid var(--content-border-color);
-
- &:last-of-type {
- border-bottom: none;
- }
-}
-
-.category-list-item,
-.subcategory-list-item {
- padding: 0 0 0 3px;
- border-left: 6px solid;
-
- h3,
- h4 {
- max-width: 100%;
- padding: 0 0 0 10px;
-
- .d-icon {
- margin-right: 5px;
- }
-
- a[href] {
- color: var(--primary);
- }
- }
-
- h3 {
- font-size: var(--font-up-2);
- }
-
- h4 {
- font-size: var(--font-up-1);
- }
-
- .category-name {
- max-width: 80vw;
- }
-
- .category-topic-link .main-link,
- .subcategories-list td,
- .category-description td {
- padding-left: 10px;
- }
-
- .category-topic-link .main-link .age {
- font-size: var(--font-down-1);
- }
-
- .category-description td {
- padding-top: 0;
- padding-bottom: 15px;
- }
-
- .subcategories-list {
- border-bottom: none;
-
- td {
- padding-top: 15px;
- }
- }
-
- .category-topic-link {
- .num {
- white-space: nowrap;
- }
-
- .topic-excerpt {
- width: 110%;
- }
- }
-
- .posters {
- float: left;
- }
-
- > footer {
- border-top: 1px solid var(--content-border-color);
- padding: 7px 10px;
-
- .category-stat {
- float: left;
- margin: 3px 1em 0 0;
- font-weight: normal;
- font-size: var(--font-down-1);
-
- .value {
- font-weight: bold;
- }
- }
-
- .btn {
- float: right;
- margin-left: 7px;
- }
- }
-}
-
-.category-list-item {
- padding: 0.5em 0 0.25em;
- border-top: 1px solid var(--content-border-color) !important;
- border-bottom: 1px solid var(--content-border-color) !important;
- margin: 1em 0 2em;
-}
-
-.category-box {
- h3 {
- margin: 0 0 0.5em 0;
- }
-}
-
-.category-topics-count a {
- color: var(--primary);
-}
-
-.topic-list-bottom {
- margin: 20px 0 0 0;
-}
-
-// Misc. stuff
-// --------------------------------------------------
-.dropdown,
-.multiselect {
- position: relative;
-}
-
-.dropdown-toggle:active,
-.open .dropdown-toggle {
- outline: 0;
-}
-
-.fade.in {
- opacity: 1;
-}
-
-.category-heading {
- p {
- font-size: var(--font-up-1);
- margin-bottom: 0.75em;
- }
-}
-
-.category-logo.aspect-image {
- display: block;
- margin: 1.5em 0 1em;
-}
-
-// base defines extra padding for easier click/top of title field
-// this is a bit too much for mobile
-td .main-link {
- width: 78%;
- display: inline-block;
-
- a.title {
- padding: 0.33em 0.67em 0.33em 0;
- overflow-wrap: break-word;
- }
-}
-
-.category-list.with-topics .category-list-item .category-description {
- display: none;
-}
-
-.category-list .category.muted a.category-title-link {
- color: var(--primary-medium);
- font-size: var(--font-down-1);
-}
-
-.muted-categories-link {
- margin-left: 0;
-}
-
-// Bulk select
-.topic-list-header {
- display: none;
-}
-
-.topic-list.sticky-header {
- .topic-list-header {
- display: table-header-group;
- position: sticky;
- z-index: z("base") + 2;
- top: var(--header-offset);
- background: var(--secondary);
-
- tr {
- display: flex;
- align-items: center;
- border: none;
- }
-
- .topic-list-data {
- display: none;
-
- &.bulk-select {
- display: inline-block;
- }
-
- &.default {
- display: flex;
-
- .bulk-select-topic-dropdown__count {
- display: none;
- }
- }
- }
-
- button.bulk-select {
- padding-left: 0.85em; // visual alignment
- }
- }
-}
-
-.bulk-select-topics {
- display: flex;
- flex-wrap: wrap;
- padding-left: 0.85em;
- gap: 0.5em;
- font-size: var(--font-down-1);
-
- .select-kit-collection {
- font-size: var(--font-up-1);
- }
-}
-
-.topic-list-data .pull-left {
- label {
- // bulk select checkbox
- display: flex;
- width: 45px;
- height: 45px;
- justify-content: center;
- align-items: center;
- }
-}
-
-.topic-replies-toggle-wrapper {
- border-bottom: 0.15em solid var(--primary-low);
- width: 100%;
- display: flex;
- justify-content: center;
- z-index: 1; // making sure the underline offset is on top of the topiclist
- position: relative;
-
- .topics-replies-toggle {
- flex-grow: 1;
- background: none;
- border: none;
- padding: 0.75em;
- position: relative;
-
- &.active {
- @include nav-active;
-
- &::after {
- height: 0.15em;
- bottom: -0.15em;
- }
- }
- }
-}