mirror of
https://github.com/discourse/discourse.git
synced 2025-03-06 12:35:21 +08:00
DEV: Add category-color variable (#15807)
This commit is contained in:
parent
cffc2836cb
commit
5f322605c6
@ -1,3 +1,3 @@
|
|||||||
import { htmlHelper } from "discourse-common/lib/helpers";
|
import { htmlHelper } from "discourse-common/lib/helpers";
|
||||||
|
|
||||||
export default htmlHelper((color) => `border-color: #${color}`);
|
export default htmlHelper((color) => `border-color: #${color}; `);
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
import { htmlHelper } from "discourse-common/lib/helpers";
|
||||||
|
|
||||||
|
export default htmlHelper((color) => `--category-color: #${color};`);
|
@ -1,5 +1,5 @@
|
|||||||
{{#each categories as |c|}}
|
{{#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-inner">
|
||||||
<div class="category-box-heading">
|
<div class="category-box-heading">
|
||||||
<a href={{c.url}}>
|
<a href={{c.url}}>
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{{#each categories as |c|}}
|
{{#each categories as |c|}}
|
||||||
{{plugin-outlet name="category-box-before-each-box" args=(hash category=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">
|
<div class="category-box-inner">
|
||||||
{{#unless c.isMuted}}
|
{{#unless c.isMuted}}
|
||||||
<div class="category-logo">
|
<div class="category-logo">
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
{{#unless isHidden}}
|
{{#unless isHidden}}
|
||||||
{{plugin-outlet name="category-list-above-each-category" args=(hash category=category)}}
|
{{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"}}">
|
<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}}
|
{{category-title-link category=category}}
|
||||||
{{plugin-outlet name="below-category-title-link" connectorTagName="div" args=(hash category=category)}}
|
{{plugin-outlet name="below-category-title-link" connectorTagName="div" args=(hash category=category)}}
|
||||||
{{#if category.description_excerpt}}
|
{{#if category.description_excerpt}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user