DEV: Add category-color variable (#15807)

This commit is contained in:
Jordan Vidrine 2022-02-03 13:16:27 -06:00 committed by GitHub
parent cffc2836cb
commit 5f322605c6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 7 additions and 4 deletions

View File

@ -1,3 +1,3 @@
import { htmlHelper } from "discourse-common/lib/helpers";
export default htmlHelper((color) => `border-color: #${color}`);
export default htmlHelper((color) => `border-color: #${color}; `);

View File

@ -0,0 +1,3 @@
import { htmlHelper } from "discourse-common/lib/helpers";
export default htmlHelper((color) => `--category-color: #${color};`);

View File

@ -1,5 +1,5 @@
{{#each categories as |c|}}
<div data-notification-level={{c.notificationLevelString}} style={{unless noCategoryStyle (border-color c.color)}} class="category category-box category-box-{{c.slug}} {{if c.isMuted "muted"}} {{if noCategoryStyle "no-category-boxes-style"}}">
<div data-notification-level={{c.notificationLevelString}} style={{unless noCategoryStyle (concat (border-color c.color) (category-color-variable c.color))}} class="category category-box category-box-{{c.slug}} {{if c.isMuted "muted"}} {{if noCategoryStyle "no-category-boxes-style"}}">
<div class="category-box-inner">
<div class="category-box-heading">
<a href={{c.url}}>

View File

@ -1,6 +1,6 @@
{{#each categories as |c|}}
{{plugin-outlet name="category-box-before-each-box" args=(hash category=c)}}
<div style={{unless noCategoryStyle (border-color c.color)}} data-category-id={{c.id}} data-notification-level={{c.notificationLevelString}} data-url={{c.url}} class="category category-box category-box-{{c.slug}} {{if c.isMuted "muted"}} {{if noCategoryStyle "no-category-boxes-style"}}">
<div style={{unless noCategoryStyle (concat (border-color c.color) (category-color-variable c.color))}} data-category-id={{c.id}} data-notification-level={{c.notificationLevelString}} data-url={{c.url}} class="category category-box category-box-{{c.slug}} {{if c.isMuted "muted"}} {{if noCategoryStyle "no-category-boxes-style"}}">
<div class="category-box-inner">
{{#unless c.isMuted}}
<div class="category-logo">

View File

@ -1,7 +1,7 @@
{{#unless isHidden}}
{{plugin-outlet name="category-list-above-each-category" args=(hash category=category)}}
<tr data-category-id={{category.id}} data-notification-level={{category.notificationLevelString}} class="{{if category.description_excerpt "has-description" "no-description"}} {{if category.uploaded_logo.url "has-logo" "no-logo"}}">
<td class="category {{if isMuted "muted"}} {{if noCategoryStyle "no-category-style"}}" style={{unless noCategoryStyle (border-color category.color)}}>
<td class="category {{if isMuted "muted"}} {{if noCategoryStyle "no-category-style"}}" style={{unless noCategoryStyle (concat (border-color category.color) (category-color-variable category.color))}}>
{{category-title-link category=category}}
{{plugin-outlet name="below-category-title-link" connectorTagName="div" args=(hash category=category)}}
{{#if category.description_excerpt}}