-
Notifications
You must be signed in to change notification settings - Fork 6.8k
Description
Bug, feature request, or proposal:
I have searched this problem and find #2662, but when I try to use it I found, the select component still has a problem.
After setting the theme for the overlay container, the overlying theme of select is changed.
However the problem is the Placeholder and the underline, the color is still the previous theme
I try to find the reason of the issue and find that there are some CSS define for the placeholder and underline as follows:
material2-master/src/lib/select/_select-theme.scss
.mat-select-trigger {
color: mat-color($foreground, hint-text);
.mat-select:focus:not(.mat-select-disabled) & {
color: mat-color($primary);
}
.mat-select:not(:focus).ng-invalid.ng-touched:not(.mat-select-disabled) & {
color: mat-color($warn);
}
}
.mat-select-underline {
background-color: mat-color($foreground, divider);
.mat-select:focus:not(.mat-select-disabled) & {
background-color: mat-color($primary);
}
.mat-select:not(:focus).ng-invalid.ng-touched:not(.mat-select-disabled) & {
background-color: mat-color($warn);
}
}
So when the Select is focused, these CSS Pseudo-Classes is activated, and the color is the previous theme. I think all DOM add a class of new theme .xxxxx
(such as .red-indigo
), but the pseudo-class is activated, this new theme class is not added.
I try to solve it, but I cannot find the related code to add class to the DOM
I make a demo and deploy on Firebase
https://github.com/xmeng1/ng2-material-admin
https://ng2-material-admin.firebaseapp.com/
What is the expected behavior?
What is the current behavior?
What are the steps to reproduce?
Providing a Plunker (or similar) is the best way to get the team to see your issue.
Plunker template: https://goo.gl/DlHd6U