Skip to content

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

No category styles (#9359)

Jordan Vidrine30983021e266
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 ffd3a77ca87..40fb4df22f8 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 c3aadd638c4..331d06c216d 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 d4a40fc5a97..fc718918543 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 b629646a564..755eea2b723 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 3dc34f67a15..643928faa1d 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 b7cc6432a7d..782415c5dcb 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 c5774106abc..50801d9d340 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 {