Mrs. Lastri’s dye jars are custom properties: declare --brand and --gap on :root or a card, the browser resolves var() on every element, and each table shows…
Custom properties are the foundation of every modern theme (including dark mode in this app). Unlike Sass variables, which vanish at compile time, they live at runtime: computed per element, overridable per component, switched by one theme class, and changed from JS with el.style.setProperty().
var() reads the value on the element that uses it
var(--Brand) does not read, even though --brand is defined Custom property names are case-sensitive: --Brand and --brand are two different variables. var(--Brand) looks for one that does not exist, so its fallback is used, or with no fallback the property becomes unset.el.style.setProperty('--brand', …).var() has no fallback If --brand is not defined and var(--brand) has no fallback, the declaration is invalid at computed-value time and acts as unset: background-color becomes transparent, color takes the parent’s colour. Declarations that lost the cascade do not come to the rescue. Give a fallback (var(--brand, gray)) or make sure the variable is defined on :root.--gap: 10 then padding: var(--gap), and the padding is 0 A custom property keeps its text as is, with no idea of units. padding: 10 is not valid, so the property becomes unset (0). Put the unit in the variable (--gap: 10px), or if it really is a bare number, multiply: calc(var(--gap) * 1px). Not both: calc(10px * 1px) is not valid either.--brand on :root, say to #0ea5e9 Both cloths follow: the tables and cloths have no declaration of their own, so they inherit from :root.--brand in .promo, then inspect Wulan's cloth The trace: the cloth has no declaration, so it inherits Wulan's table, where .promo beats .card by coming later. Rara's table is untouched.--brand on :root The cloths turn grey: --brand is defined nowhere, so the fallback in var(--brand, gray) is used.:hover and tick --brand in .button:hover background-color is not written again, only the variable changes. Wulan's cloth follows even when .promo has a --brand: a declaration on the element itself always beats an inherited value.