-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some sass selector expressions don't work when nested in a theme class #4077
Comments
By the way, I think the placeholder of input has the same problem which not display the primary color, |
I found another issue for the overlay if I put two Select in one component, and one is use system theme. the other one is put into the second theme. The expected behaviour is the first use the system theme, the second use the second theme. But I think current implementation, all the overlay will add the second class name. |
Took @kara a while to figure this out, but this is indeed a real bug. The issue is that some styles are using the sass .mat-select:focus:not(.mat-select-disabled) & {
background-color: mat-color($primary);
} The problem is that .mat-select:focus:not(.mat-select-disabled) .red-indigo .mat-select-trigger {
background-color: ...
} To fix this, theming files should never use the |
by using the newest method which fix the overlay bug. but there is still has some problems: 1. input placeholder 2. select placeholder and underline 3. slide bar ref issues: [multiple themes don't work with overlay-based components](angular/components#2662) [Some sass selector expressions don't work when nested in a theme class](angular/components#4077)
by using the newest method which fix the overlay bug. but there is still has some problems: 1. input placeholder 2. select placeholder and underline 3. slide bar ref issues: [multiple themes don't work with overlay-based components](angular/components#2662) [Some sass selector expressions don't work when nested in a theme class](angular/components#4077)
@jelbourn you are right, I just replace the Ampersand to the normal format in |
* Fixes certain theme selectors being broken due to uses of the `&` operator at the end of the selector. * Adds a custom Stylelint rule to catch future improper uses of the ampersand inside themes. Relates to angular#3928. Fixes angular#4077.
* Fixes certain theme selectors being broken due to uses of the `&` operator at the end of the selector. * Adds a custom Stylelint rule to catch future improper uses of the ampersand inside themes. Relates to angular#3928. Fixes angular#4077.
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. |
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
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
What is the use-case or motivation for changing an existing behavior?
Which versions of Angular, Material, OS, browsers are affected?
Is there anything else we should know?
The text was updated successfully, but these errors were encountered: