Skip to content

Commit 5ff2620

Browse files
committed
DEV: replace inline color with a CSS variable
1 parent ddd2d94 commit 5ff2620

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

common/common.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ div[class^="category-title-header"] {
4747
display: flex;
4848
width: 100%;
4949
justify-content: center;
50+
background: var(--category-banner-bg-color);
51+
color: var(--category-banner-color);
5052

5153
@if $align_text == "center" {
5254
text-align: center;

javascripts/discourse/components/category-banner.gjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export default class DiscourseCategoryBanners extends Component {
4545

4646
get safeStyle() {
4747
return htmlSafe(
48-
`background-color: #${this.category.color}; color: #${this.category.text_color};`
48+
`--category-banner-bg-color: #${this.category.color}; --category-banner-color: #${this.category.text_color};`
4949
);
5050
}
5151

0 commit comments

Comments
 (0)