Repository navigation
fix(material-experimental/mdc-input): native select option blending in with background on dark themes - #19232
Conversation
devversion
left a comment
There was a problem hiding this comment.
LGTM. I could imagine this also being part of the native-select mixin in the form-field. Mostly because non-theme styles for the select already live there.
That could help with style organization in the form-field, but I guess since the same code previously was in mat-input, it could be considered breaking.
|
We can't have this be in the native select mixin, because it's using theme colors. |
|
Oh, I meant that we place it as a separate mixin in the dedicated |
|
We can't really do that, because we're inverting the color: we're using the light theme color for a dark theme. I don't think that MDC's API supports something like that. |
|
The snippet I sent just demonstrated that these dedicated files (for parts of a form-field) can have multiple mixins. It's totally possible to pass through a |
|
But then we'd be mixing non-theme styles with theming ones. I don't think we're doing that anywhere else, aside from the MDC form field. |
|
That's fair. I don't consider this a big deal though. It makes more sense to me to group them by part, and not based on what is theme or not. That should be obvious enough based on mixin name. I don't mind too much, I'm just saying that we are already doing this in the form field, and this one will fall out of that pattern. Maybe @mmalerba has a feeling on this. In the initial form field PR I was asked to move this non-theme code into mixins; so since these files always are partials now, it should be fine having the theme mixin inside there too |
| @include mat-using-mdc-theme($theme) {} | ||
| @include mat-using-mdc-theme($theme) { | ||
| .mat-mdc-input-element { | ||
| // On dark themes we set the native `select` color to some shade of white, |
There was a problem hiding this comment.
Hmm, I wonder if this will still be an issue if you have your browser in dark mode, or maybe it does some magic color inverting stuff for you - anyways if it is an issue it seems like a bigger thing than just this case
|
Oh sorry, I missed @devversion's comment. I think since there's already a precedent for doing it for other parts of the form field, it would be fine to make it a separate native select mixin |
…ing in with background on dark themes On dark themes the `color` of the native `select` inside of an MDC-based form field is usually set to some shade of white. The problem is that the color of the native `select` dropdown preserves its white background, making the text invisible. These changes make it so that the options always use a dark text color.
a6d9022 to
e0d481a
Compare
|
Done. |
…ing in with background on dark themes (#19232) On dark themes the `color` of the native `select` inside of an MDC-based form field is usually set to some shade of white. The problem is that the color of the native `select` dropdown preserves its white background, making the text invisible. These changes make it so that the options always use a dark text color.
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |

On dark themes the
colorof the nativeselectinside of an MDC-based form field is usually set to some shade of white. The problem is that the color of the nativeselectdropdown preserves its white background, making the text invisible. These changes make it so that the options always use a dark text color.