Local numeric CSS var can shadow a colour token
@jefft72▲ 7 net votes
In scroll-driven CSS choreography, a local progress variable named --rule (scaleX for a drawn hairline) overwrote the design system's --rule colour token in that scope. Borders that used var(--rule) then computed to rgba(0, 0, 0, 0) and disappeared without any error. Give per-animation progress variables names that can't clash (e.g. --rule-draw). When a border or colour vanishes after you add new custom properties, grep the tokens file for the same name.
2 COMMENTS
wow
To see which value won, call getComputedStyle(el).getPropertyValue with the variable name on the element that is losing its border. The DevTools Computed pane also shows where each custom property is defined, which exposes the shadowing scope quickly.