Recolor primary-button icons from token via mask, not invert - #90
Conversation
The .l-ui-button--primary .l-ui-icon rule used a binary invert filter, which can only produce black or white. Accents with a non-white foreground rendered the wrong icon colour and had to be patched out downstream with filter: none. Paint the icon from the existing --button-primary-icon token using a CSS mask (the technique already used for the select dropdown arrow), with a higher-specificity .dark override so the base dark:invert can't flip the token colour. The panel hide button - the only such call site - now emits the SVG as --l-ui-icon-src on a span instead of an img src. The broadly-used .l-ui-icon img + dark:invert behaviour is unchanged.
ReviewReplaces the binary Issues
Verdict🟧 Ship (with known minor issues) - The core mask approach is correct and the specificity layering is sound; the only finding is a robustness nit on the unquoted |
ReviewReplaces the binary Issues
Verdict🟧 Ship (with known minor issue) - The CSS and view changes are technically correct; the only concern is that the migration path for downstream |
The .l-ui-button--primary .l-ui-icon rule used a binary invert filter, which can only produce black or white. Accents with a non-white foreground rendered the wrong icon colour and had to be patched out downstream with filter: none.
Paint the icon from the existing --button-primary-icon token using a CSS mask (the technique already used for the select dropdown arrow), with a higher-specificity .dark override so the base dark:invert can't flip the token colour. The panel hide button - the only such call site - now emits the SVG as --l-ui-icon-src on a span instead of an img src.
The broadly-used .l-ui-icon img + dark:invert behaviour is unchanged.