FIX: Use same names for category CSS variables (#24527)
--category-bg-color and --category-badge-color were both used to represent category.color. --category-badge-color is now used instead for all of them.
This commit is contained in:
parent
3a67a0280f
commit
d5f459db14
|
@ -16,19 +16,7 @@
|
||||||
{{#each this.categoryBreadcrumbs as |breadcrumb|}}
|
{{#each this.categoryBreadcrumbs as |breadcrumb|}}
|
||||||
{{#if breadcrumb.hasOptions}}
|
{{#if breadcrumb.hasOptions}}
|
||||||
<li
|
<li
|
||||||
style={{html-safe
|
style={{if breadcrumb.category (category-variables breadcrumb.category)}}
|
||||||
(if
|
|
||||||
breadcrumb.category
|
|
||||||
(concat
|
|
||||||
"--category-bg-color:#"
|
|
||||||
breadcrumb.category.color
|
|
||||||
"; "
|
|
||||||
"--category-text-color:#"
|
|
||||||
breadcrumb.category.text_color
|
|
||||||
";"
|
|
||||||
)
|
|
||||||
)
|
|
||||||
}}
|
|
||||||
>
|
>
|
||||||
<CategoryDrop
|
<CategoryDrop
|
||||||
@category={{breadcrumb.category}}
|
@category={{breadcrumb.category}}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { htmlSafe } from "@ember/template";
|
import { htmlSafe } from "@ember/template";
|
||||||
|
|
||||||
export default function categoryColorVariable(color) {
|
export default function categoryColorVariable(color) {
|
||||||
return htmlSafe(`--category-color: #${color};`);
|
return htmlSafe(`--category-badge-color: #${color};`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
import { htmlSafe } from "@ember/template";
|
||||||
|
|
||||||
|
export default function categoryVariables(category) {
|
||||||
|
let vars = "";
|
||||||
|
|
||||||
|
if (category.color) {
|
||||||
|
vars += `--category-badge-color: #${category.color};`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (category.text_color) {
|
||||||
|
vars += `--category-badge-text-color: #${category.text_color};`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (category.parentCategory?.color) {
|
||||||
|
vars += `--parent-category-badge-color: #${category.parentCategory.color};`;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (category.parentCategory?.text_color) {
|
||||||
|
vars += `--parent-category-badge-text-color: #${category.parentCategory.text_color};`;
|
||||||
|
}
|
||||||
|
|
||||||
|
return htmlSafe(vars);
|
||||||
|
}
|
|
@ -58,7 +58,7 @@
|
||||||
border-width: 0;
|
border-width: 0;
|
||||||
border-left-width: 6px;
|
border-left-width: 6px;
|
||||||
border-style: solid;
|
border-style: solid;
|
||||||
border-color: var(--category-color, var(--primary-low));
|
border-color: var(--category-badge-color, var(--primary-low));
|
||||||
|
|
||||||
.mobile-view & {
|
.mobile-view & {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
|
@ -89,7 +89,7 @@
|
||||||
|
|
||||||
tbody {
|
tbody {
|
||||||
.category {
|
.category {
|
||||||
border-left: 6px solid var(--category-color, var(--primary-low));
|
border-left: 6px solid var(--category-badge-color, var(--primary-low));
|
||||||
h3,
|
h3,
|
||||||
h4 {
|
h4 {
|
||||||
line-height: var(--line-height-medium);
|
line-height: var(--line-height-medium);
|
||||||
|
|
Loading…
Reference in New Issue