No category styles (#9359)

No category styles (#9359)

  • UI: “No category styles” apply to category boxes
diff --git a/app/assets/javascripts/discourse/components/categories-boxes-with-topics.js b/app/assets/javascripts/discourse/components/categories-boxes-with-topics.js
index ffd3a77..40fb4df 100644
--- a/app/assets/javascripts/discourse/components/categories-boxes-with-topics.js
+++ b/app/assets/javascripts/discourse/components/categories-boxes-with-topics.js
@@ -1,6 +1,7 @@
 import discourseComputed from "discourse-common/utils/decorators";
 import { isEmpty } from "@ember/utils";
 import Component from "@ember/component";
+import { equal } from "@ember/object/computed";
 
 export default Component.extend({
   tagName: "section",
@@ -8,6 +9,7 @@ export default Component.extend({
     ":category-boxes-with-topics",
     "anyLogos:with-logos:no-logos"
   ],
+  noCategoryStyle: equal("siteSettings.category_style", "none"),
 
   @discourseComputed("categories.[].uploaded_logo.url")
   anyLogos() {
diff --git a/app/assets/javascripts/discourse/components/categories-boxes.js b/app/assets/javascripts/discourse/components/categories-boxes.js
index c3aadd6..331d06c 100644
--- a/app/assets/javascripts/discourse/components/categories-boxes.js
+++ b/app/assets/javascripts/discourse/components/categories-boxes.js
@@ -1,6 +1,7 @@
 import discourseComputed from "discourse-common/utils/decorators";
 import { isEmpty } from "@ember/utils";
 import Component from "@ember/component";
+import { equal } from "@ember/object/computed";
 
 export default Component.extend({
   tagName: "section",
@@ -9,6 +10,7 @@ export default Component.extend({
     "anyLogos:with-logos:no-logos",
     "hasSubcategories:with-subcategories"
   ],
+  noCategoryStyle: equal("siteSettings.category_style", "none"),
 
   @discourseComputed("categories.[].uploaded_logo.url")
   anyLogos() {
diff --git a/app/assets/javascripts/discourse/templates/components/categories-boxes-with-topics.hbs b/app/assets/javascripts/discourse/templates/components/categories-boxes-with-topics.hbs
index d4a40fc..fc71891 100644
--- a/app/assets/javascripts/discourse/templates/components/categories-boxes-with-topics.hbs
+++ b/app/assets/javascripts/discourse/templates/components/categories-boxes-with-topics.hbs
@@ -1,5 +1,5 @@
 {{#each categories as |c|}}
-  <div data-notification-level={{c.notificationLevelString}} class='category category-box category-box-{{c.slug}} {{if c.isMuted "muted"}}' style={{border-color c.color}}>
+  <div data-notification-level={{c.notificationLevelString}} class='category category-box category-box-{{c.slug}} {{if c.isMuted "muted"}} {{if noCategoryStyle "no-category-boxes-style"}}' style={{unless noCategoryStyle (border-color c.color)}}>
     <div class='category-box-inner'>
       <div class='category-box-heading'>
         <a href={{c.url}}>
diff --git a/app/assets/javascripts/discourse/templates/components/categories-boxes.hbs b/app/assets/javascripts/discourse/templates/components/categories-boxes.hbs
index b629646..755eea2 100644
--- a/app/assets/javascripts/discourse/templates/components/categories-boxes.hbs
+++ b/app/assets/javascripts/discourse/templates/components/categories-boxes.hbs
@@ -1,5 +1,5 @@
 {{#each categories as |c|}}
-  <div class='category category-box category-box-{{c.slug}} {{if c.isMuted "muted"}}' style={{border-color c.color}} data-category-id={{c.id}} data-notification-level={{c.notificationLevelString}}
+  <div class='category category-box category-box-{{c.slug}} {{if c.isMuted "muted"}} {{if noCategoryStyle "no-category-boxes-style"}}' style={{unless noCategoryStyle (border-color c.color)}} data-category-id={{c.id}} data-notification-level={{c.notificationLevelString}}
    data-url={{c.url}}>
     <div class='category-box-inner'>
       {{#unless c.isMuted}}
diff --git a/app/assets/javascripts/discourse/templates/user/messages.hbs b/app/assets/javascripts/discourse/templates/user/messages.hbs
index 3dc34f6..643928f 100644
--- a/app/assets/javascripts/discourse/templates/user/messages.hbs
+++ b/app/assets/javascripts/discourse/templates/user/messages.hbs
@@ -1,7 +1,7 @@
 {{#d-section class="user-secondary-navigation" pageClass="user-messages"}}
   {{#unless site.mobileView}}
     {{#if showNewPM}}
-      {{d-button class="btn-primary new-private-message" action=(route-action "composePrivateMessage") icon="envelope" label="user.new_private_message"}}
+      {{d-button class="btn-primary new-" action=(route-action "composePrivateMessage") icon="envelope" label="user.new_private_message"}}
     {{/if}}
   {{/unless}}
 
@@ -72,7 +72,7 @@
     {{#if site.mobileView}}
       {{#if showNewPM}}
         {{d-button
-          class="btn-primary new-private-message"
+          class="btn-primary new-"
           action=(route-action "composePrivateMessage")
           icon="envelope"
           label="user.new_private_message"}}
diff --git a/app/assets/stylesheets/common/base/category-list.scss b/app/assets/stylesheets/common/base/category-list.scss
index b7cc643..782415c 100644
--- a/app/assets/stylesheets/common/base/category-list.scss
+++ b/app/assets/stylesheets/common/base/category-list.scss
@@ -324,3 +324,19 @@
     color: $primary-medium;
   }
 }
+
+.category-list {
+  tbody {
+    .category {
+      &.no-category-style {
+        border-color: transparent;
+        border-left: 0px;
+        padding-left: 0px;
+      }
+    }
+  }
+}
+
+.category-box.no-category-boxes-style {
+  border-left-width: 2px;
+}
diff --git a/app/assets/stylesheets/desktop/category-list.scss b/app/assets/stylesheets/desktop/category-list.scss
index c577410..50801d9 100644
--- a/app/assets/stylesheets/desktop/category-list.scss
+++ b/app/assets/stylesheets/desktop/category-list.scss
@@ -94,11 +94,6 @@
 
   tbody {
     .category {
-      &.no-category-style {
-        border-color: transparent;
-        border-left: 0px;
-        padding-left: 0px;
-      }
       border-left: 6px solid;
       h3,
       h4 {

GitHub sha: 30983021

This commit appears in #9359 which was approved by eviltrout. It was merged by jordanvidrine.