[Button] Inconsistent Text/Background Colors When Using CSS Variables on Edge #5044
Description
Bug report
edgeOptOut
is enabled for button container fill color but not icon or ink color, leading to buttons that have poor contrast due to the inconsistency in Edge
@mixin mdc-button-container-fill-color($color, $query: mdc-feature-all()) {
$feat-color: mdc-feature-create-target($query, color);
// :not(:disabled) is used to support link styled as button
// as link does not support :enabled style
&:not(:disabled) {
@include mdc-feature-targets($feat-color) {
@include mdc-theme-prop(background-color, $color, $edgeOptOut: true);
}
}
}
@mixin mdc-button-ink-color($color, $query: mdc-feature-all()) {
$feat-color: mdc-feature-create-target($query, color);
&:not(:disabled) {
@include mdc-feature-targets($feat-color) {
@include mdc-theme-prop(color, $color);
}
}
}
Note the mdc-theme-prop
calls in the mdc code above.
Steps to reproduce
Actual behavior
The "themed button" has a light red background with dark text in Chrome/Firefox, but a dark purple background with dark text in Edge (I use browserstack to compare)
Expected behavior
The "themed" button should ideally have a light red background in Edge (css variables appear to be supported now)... or at least keep the white text from the sass configuration
Screenshots
Your Environment:
Software | Version(s) |
---|---|
MDC Web | 3.1.0 |
Browser | Edge 18 |
Operating System | Windows 10 |
Additional context
None I can think of
Possible solution
Preferably remove edgeOptOut functionality... if I'm wrong and there's some edge cases that still don't work then possibly make it global so people can opt in or not? If global isn't a good option, possibly every mixin needs to pass it down so people can override it on a case-by-case basis?