UX: Support for `none` style of category badge

This commit is contained in:
Robin Ward 2017-08-04 14:12:21 -04:00
parent 4bfb049054
commit 6ecb7cdff4
3 changed files with 15 additions and 6 deletions

View File

@ -43,17 +43,17 @@ export function categoryBadgeHTML(category, opts) {
parentCat = Discourse.Category.findById(get(category, 'parent_category_id'));
}
if (parentCat && parentCat !== category) {
html += categoryStripe(get(parentCat,'color'), "badge-category-parent-bg");
const categoryStyle = opts.categoryStyle || Discourse.SiteSettings.category_style;
if (categoryStyle !== "none") {
if (parentCat && parentCat !== category) {
html += categoryStripe(get(parentCat,'color'), "badge-category-parent-bg");
}
html += categoryStripe(color, "badge-category-bg");
}
html += categoryStripe(color, "badge-category-bg");
let classNames = "badge-category clear-badge";
if (restricted) { classNames += " restricted"; }
const categoryStyle = opts.categoryStyle || Discourse.SiteSettings.category_style;
let style = "";
if (categoryStyle === "box") {
style = `style="color: #${get(category, 'text_color')};"`;

View File

@ -51,6 +51,11 @@
}
}
&.none { // no category style
color: $primary;
margin-right: 5px;
}
&.bullet { //bullet category style
display: inline-flex;
align-items: baseline;
@ -209,6 +214,9 @@
max-width: 100px;
}
}
&.none {
padding: 5px;
}
&.bullet {
padding: 5px;
width: 100%;

View File

@ -182,6 +182,7 @@ basic:
- bar
- box
- bullet
- none
enable_mobile_theme:
client: true
default: true