Raise ContainerColor's specificity so the theme text color beats folds' DefaultReset in any stylesheet order.

This commit is contained in:
2026-11-03 09:30:11 +11:00
parent 9b3956d85f
commit fcfb40549a
+8 -1
View File
@@ -7,9 +7,16 @@ const getVariant = (variant: TContainerColor): ComplexStyleRule => ({
backgroundColor: color[variant].Container,
borderColor: color[variant].ContainerLine,
outlineColor: color[variant].ContainerLine,
color: color[variant].OnContainer,
},
selectors: {
// DefaultReset sets `color: inherit` with the same specificity as this rule,
// so which one wins depends on stylesheet order. In the Android build the
// ContainerColor chunk is emitted before folds' reset, so the theme color
// loses and text falls back to the initial color. Raise specificity so the
// theme color wins regardless of order.
'&[class]': {
color: color[variant].OnContainer,
},
'button&[aria-pressed=true]': {
backgroundColor: color[variant].ContainerActive,
},