:root { --card-accent: #0f766e; } .card--alert { --card-accent: #dc2626; } .card-title { color: var(--card-accent); }Normal cards use green, while the alert variant changes the token locally to red.
LESSON 93 OF 100
Change the accent only for the alert card variant.
Custom properties inherit by default. A closer value in the tree can override the token for a component and its descendants without duplicating the consuming rule.
:root { --card-accent: #0f766e; } .card--alert { --card-accent: #dc2626; } .card-title { color: var(--card-accent); }Normal cards use green, while the alert variant changes the token locally to red.
.card-title { color: #0f766e; } .card--alert .card-title { color: #dc2626; }Duplicating the rule works visually but does not practise configuring the component through an inherited token.
Define the base #0f766e token, override it with #dc2626 in .card--alert and read it in .card-title.
The same .card-title rule consumes the token, while the cascade selects the value for each context.
ANALYSIS REQUEST
The initial discussion is without obligation. You receive an honest recommendation, suitable stages and the factors that affect price.