Raise ContainerColor's specificity so the theme text color beats folds' DefaultReset in any stylesheet order.
This commit is contained in:
@@ -7,9 +7,16 @@ const getVariant = (variant: TContainerColor): ComplexStyleRule => ({
|
|||||||
backgroundColor: color[variant].Container,
|
backgroundColor: color[variant].Container,
|
||||||
borderColor: color[variant].ContainerLine,
|
borderColor: color[variant].ContainerLine,
|
||||||
outlineColor: color[variant].ContainerLine,
|
outlineColor: color[variant].ContainerLine,
|
||||||
color: color[variant].OnContainer,
|
|
||||||
},
|
},
|
||||||
selectors: {
|
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]': {
|
'button&[aria-pressed=true]': {
|
||||||
backgroundColor: color[variant].ContainerActive,
|
backgroundColor: color[variant].ContainerActive,
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user