Skip to content

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

DEV: merge desktop category-list css into common file (#39307)

Kris7756b1fab45f
diff --git a/app/assets/stylesheets/common/base/category-list.scss b/app/assets/stylesheets/common/base/category-list.scss
index c19306544a2..c1dfeb2543d 100644
--- a/app/assets/stylesheets/common/base/category-list.scss
+++ b/app/assets/stylesheets/common/base/category-list.scss
@@ -8,8 +8,164 @@
.category-list {
table-layout: fixed;
+ @include viewport.from(sm) {
+ margin-bottom: 10px;
+ width: 100%;
+
+ td,
+ th {
+ padding: 12px 5px;
+ color: var(--primary-med-or-secondary-high);
+ }
+
+ td {
+ vertical-align: top;
+
+ &:first-of-type {
+ padding-left: 10px;
+ }
+ }
+
+ th {
+ vertical-align: middle;
+ }
+
+ .topics .badge-notification,
+ .category .badge-notification {
+ background-color: transparent;
+ color: var(--primary-med-or-secondary-high);
+ }
+
+ .topics {
+ width: 80px;
+ text-align: right;
+
+ .value {
+ font-size: var(--font-up-1);
+ font-weight: bold;
+ }
+
+ .unit {
+ font-size: var(--font-down-1);
+ }
+
+ .badge-notification {
+ display: block;
+ text-align: right;
+ padding-right: 0;
+
+ &:first-child {
+ margin-top: 0.75em;
+ }
+ }
+ }
+
+ .subcategories {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.15em 0.75em;
+ margin-top: 0.5em;
+
+ .subcategory {
+ display: inline-flex;
+ align-items: baseline;
+ gap: 0.25em;
+
+ @include ellipsis;
+
+ .badge-category {
+ min-width: 0;
+ }
+ }
+
+ .category__badges {
+ display: flex;
+ gap: 0.25em;
+
+ .badge-notification {
+ top: 0;
+ padding: 0;
+ }
+ }
+
+ .badge-notification.unread-posts {
+ display: block;
+ padding: 0;
+ }
+
+ &__more-subcategories {
+ font-size: var(--font-down-1);
+
+ a {
+ color: var(--primary-high);
+ }
+ }
+ }
+
+ .featured-topic {
+ margin: 10px 0 0;
+ display: flex;
+ align-items: baseline;
+
+ &:first-of-type {
+ margin-top: 13px;
+ }
+
+ a.last-posted-at,
+ a.last-posted-at:visited {
+ font-size: var(--font-down-1);
+ color: var(--primary-med-or-secondary-high);
+ }
+
+ .title {
+ @include ellipsis;
+ flex: 0 1 auto;
+ }
+
+ .topic-post-badges .badge.unread-posts,
+ .title {
+ margin-right: 5px;
+ }
+
+ &.--glimmer button.-trigger {
+ background: transparent;
+ border: none;
+ padding: 0;
+ }
+
+ .topic-statuses {
+ display: flex;
+ }
+ }
+ }
+
tbody {
.category {
+ @include viewport.from(sm) {
+ border-left: 6px solid var(--category-badge-color, var(--primary-low));
+
+ h3,
+ h4 {
+ line-height: var(--line-height-medium);
+
+ a[href] {
+ color: var(--primary);
+ }
+ }
+
+ h3 {
+ font-size: var(--font-up-2);
+ }
+
+ h4 {
+ font-size: var(--font-up-1);
+ }
+
+ .latest {
+ padding: 0 0 10px 10px;
+ }
+ }
+
&.no-category-style {
border-color: transparent;
border-left: 0;
@@ -33,6 +189,14 @@
}
&.with-topics {
+ @include viewport.from(sm) {
+ margin-left: 3px;
+
+ .category {
+ width: 45%;
+ }
+ }
+
.subcategories-with-subcategories {
.category-description {
display: none;
@@ -659,3 +823,37 @@
color: var(--primary);
}
}
+
+@include viewport.from(sm) {
+ .categories-and-latest,
+ .categories-and-top {
+ display: flex;
+ flex-flow: row wrap;
+
+ div.column {
+ flex: 1 0 0px;
+ flex-direction: row;
+ min-width: 300px;
+ }
+
+ div.column.categories {
+ margin-right: 1em;
+
+ @media all and (width >= 700px) {
+ margin-right: 2em;
+ }
+ }
+
+ .discourse-tags {
+ .discourse-tag {
+ font-size: var(--font-down-1);
+ }
+ }
+
+ .subcategories-with-subcategories {
+ .category-description {
+ display: none;
+ }
+ }
+ }
+}
diff --git a/app/assets/stylesheets/desktop.scss b/app/assets/stylesheets/desktop.scss
index 6f59b69b0a1..c6426b3a5a1 100644
--- a/app/assets/stylesheets/desktop.scss
+++ b/app/assets/stylesheets/desktop.scss
@@ -1,4 +1,2 @@
-@import "desktop/_index";
-
// Import all component-specific files
@import "desktop/components/_index";
diff --git a/app/assets/stylesheets/desktop/_index.scss b/app/assets/stylesheets/desktop/_index.scss
deleted file mode 100644
index e39c1026480..00000000000
--- a/app/assets/stylesheets/desktop/_index.scss
+++ /dev/null
@@ -1 +0,0 @@
-@import "category-list";
diff --git a/app/assets/stylesheets/desktop/category-list.scss b/app/assets/stylesheets/desktop/category-list.scss
deleted file mode 100644
index 520bdfc6426..00000000000
--- a/app/assets/stylesheets/desktop/category-list.scss
+++ /dev/null
@@ -1,203 +0,0 @@
-.category-list {
- margin-bottom: 10px;
- width: 100%;
-
- td,
- th {
- padding: 12px 5px;
- color: var(--primary-med-or-secondary-high);
- }
-
- td {
- vertical-align: top;
- }
-
- th {
- vertical-align: middle;
- }
-
- td:first-of-type {
- padding-left: 10px;
- }
-
- &.with-topics {
- margin-left: 3px;
-
- .category {
- width: 45%;
- }
- }
-
- .topics .badge-notification,
- .category .badge-notification {
- background-color: transparent;
- color: var(--primary-med-or-secondary-high);
- }
-
- .topics {
- width: 80px;
- text-align: right;
-
- .value {
- font-size: var(--font-up-1);
- font-weight: bold;
- }
-
- .unit {
- font-size: var(--font-down-1);
- }
-
- .badge-notification {
- display: block;
- text-align: right;
- padding-right: 0;
-
- &:first-child {
- margin-top: 0.75em;
- }
- }
- }
-
- .subcategories {
- display: flex;
- flex-wrap: wrap;
- gap: 0.15em 0.75em;
- margin-top: 0.5em;
-
- .subcategory {
- display: inline-flex;
- align-items: baseline;
- gap: 0.25em;
-
- @include ellipsis;
-
- .badge-category {
- min-width: 0;
- }
- }
-
- .category__badges {
- display: flex;
- gap: 0.25em;
-
- .badge-notification {
- top: 0;
- padding: 0;
- }
- }
-
- .badge-notification.unread-posts {
- display: block;
- padding: 0;
- }
-
- &__more-subcategories {
- font-size: var(--font-down-1);
-
- a {
- color: var(--primary-high);
- }
- }
- }
-
- .featured-topic {
- margin: 10px 0 0;
- display: flex;
- align-items: baseline;
-
- &:first-of-type {
- margin-top: 13px;
- }
-
- a.last-posted-at,
- a.last-posted-at:visited {
- font-size: var(--font-down-1);
- color: var(--primary-med-or-secondary-high);
- }
-
- .title {
- @include ellipsis;
- flex: 0 1 auto;
- }
-
- .topic-post-badges .badge.unread-posts,
- .title {
- margin-right: 5px;
- }
-
- &.--glimmer button.-trigger {
- background: transparent;
- border: none;
- padding: 0;
- }
-
- .topic-statuses {
- display: flex;
- }
- }
-
- tbody {
- .category {
- border-left: 6px solid var(--category-badge-color, var(--primary-low));
-
- h3,
- h4 {
- line-height: var(--line-height-medium);
-
- a[href] {
- color: var(--primary);
- }
- }
-
- h3 {
- font-size: var(--font-up-2);
- }
-
- h4 {
- font-size: var(--font-up-1);
- }
- }
-
- .latest {
- padding: 0 0 10px 10px;
- }
- }
-}
-
-.categories-and-latest,
-.categories-and-top {
- display: flex;
- flex-flow: row wrap;
-
- div.column {
- flex: 1 0 0px;
- flex-direction: row;
- min-width: 300px;
- }
-
- div.column.categories {
- @media all and (width <= 600px) {
- margin-right: 0;
- }
-
- @media all and (width >= 600px) {
- margin-right: 1em;
- }
-
- @media all and (width >= 700px) {
- margin-right: 2em;
- }
- }
-
- .discourse-tags {
- .discourse-tag {
- font-size: var(--font-down-1);
- }
- }
-
- .subcategories-with-subcategories {
- .category-description {
- display: none;
- }
- }
-}