-
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
bug(button): Palette contrast values are not applied #26056
Comments
Also ran into this issue. In my case with a slightly light primary color
The issue seems to be, that the button uses the on-primary calculated by the mdc-theme See:
Whereas the toolbar uses the contrast color defined by the custom theme. See:
|
We're having the same issue, using the cyan 600 color as primary, button color (text and icons) is black. It used to be white before. However, I've noticed that using a slightly darker cyan 700, the color seems to work again. But, then the primary color is off, of course😀 |
Same issue, and breaking all my product styles and need to be overwritten, forcing colors hardcoding rules |
Notify me if resolved. |
Also facing the same issue. |
Same issue. |
are there any updates yet? |
Same issue for me, my workaround:
|
The problem is still there. The Angular Material v15 is not usable for more than 2 months. |
Just as an information for others facing an issue like this: |
Any chance this will get fixed soon? I need my contrast color to get used because our CI uses a white font on a pretty light blue. Now all the buttons etc. have a black text. Checkbox' checkmark is affected, too (just like probably most of the compontents). |
More details here: #26153 |
the same issue to me as well, contrast color does not work. |
same issue here |
Same issue. As @beckerjohannes mentioned above, the issue is that for buttons the contrast color is not used. Instead the The
Now
As you can see, the minimal contrast is hardcoded. Depending on the contrast the tone is set to |
Same issue here. Hope it'll get fixed soon! :) Thank you @Frankitch for the workaround! |
See: #26179 for the same kind of issues |
Same with checkboxes |
Angular 16 is already live, and this is not fixed. Any news on this? |
I have the same problem with buttons and checkboxes. Contrast color of my custom theme is not applied correctly. |
Most of the Angular Material Components don't work properly for the color. I don't know how this as not been fix already. Should have been fix first week after the release of v15, yet here we are at v16 and the problem persist. I'm deceived by this. |
Same here! V16.1.3 as well, i had to override text color for raised button as contrast palette wasn't applied. |
The same error. I want assign my theme and dont want rewriting initial vars, cause it`s bad idea or crutch |
Same here. I've been hitting myself in the head for the past two hours… thank god I found this issue. Thanks for the fix @Plabbee |
Same problem in Angular Material 17.1.0. I'm using the package from @Plabbee for workaround, it works perfectly! |
Pls fix this. There is actually a forked repo with a fix. This bug is super painful, because even if you got a workaround, it breaks on every major update eventually and one has to find a new workaround. This is the 3rd time i'm stumbling over this. |
This is a real show stopper for version 17. This version should be considered as beta. I am not able to update without destroyed branding and I have to stay on v16 with legacy components. |
Why are the Angular Material team not reponding to this issue?! |
Imagine being asked by your manager to update your project to the latest version and having to tell them "sorry I can't, Angular team broke the CSS formatting and won't fix it". I'm sure that'd go over great. Please, fix this already. Edit: crisbeto has swept in and saved us! |
During the transition to tokens, we ended up with a bunch of places with hardcoded values in the form of `if($is-dark, #fff, #000)`. This is problematic for custom palettes, because the value is always hardcoded. These changes attempt to derive the same values from the palette directly. Fixes angular#26056.
During the transition to tokens, we ended up with a bunch of places with hardcoded values in the form of `if($is-dark, #fff, #000)`. This is problematic for custom palettes, because the value is always hardcoded. These changes attempt to derive the same values from the palette directly. Fixes angular#26056.
During the transition to tokens, we ended up with a bunch of places with hardcoded values in the form of `if($is-dark, #fff, #000)`. This is problematic for custom palettes, because the value is always hardcoded. These changes attempt to derive the same values from the palette directly. Fixes angular#26056.
During the transition to tokens, we ended up with a bunch of places with hardcoded values in the form of `if($is-dark, #fff, #000)`. This is problematic for custom palettes, because the value is always hardcoded. These changes attempt to derive the same values from the palette directly. Fixes angular#26056.
During the transition to tokens, we ended up with a bunch of places with hardcoded values in the form of `if($is-dark, #fff, #000)`. This is problematic for custom palettes, because the value is always hardcoded. These changes attempt to derive the same values from the palette directly. Fixes angular#26056.
This is really painful. Is there no hope? The fact I need a bazooka to change the text color of a button after creating a palette is actually insane. The additional tech debt I need to add to my project for a button text color is really frustrating. |
@noel-invonto I was about to say "No there is no hope" as it's been ignored for over a year. And I get an email at least once a week from the various tickets on this. |
During the transition to tokens, we ended up with a bunch of places with hardcoded values in the form of `if($is-dark, #fff, #000)`. This is problematic for custom palettes, because the value is always hardcoded. These changes attempt to derive the same values from the palette directly. Fixes angular#26056.
During the transition to tokens, we ended up with a bunch of places with hardcoded values in the form of `if($is-dark, #fff, #000)`. This is problematic for custom palettes, because the value is always hardcoded. These changes attempt to derive the same values from the palette directly. Fixes angular#26056.
During the transition to tokens, we ended up with a bunch of places with hardcoded values in the form of `if($is-dark, #fff, #000)`. This is problematic for custom palettes, because the value is always hardcoded. These changes attempt to derive the same values from the palette directly. Fixes angular#26056.
During the transition to tokens, we ended up with a bunch of places with hardcoded values in the form of `if($is-dark, #fff, #000)`. This is problematic for custom palettes, because the value is always hardcoded. These changes attempt to derive the same values from the palette directly. Fixes #26056.
During the transition to tokens, we ended up with a bunch of places with hardcoded values in the form of `if($is-dark, #fff, #000)`. This is problematic for custom palettes, because the value is always hardcoded. These changes attempt to derive the same values from the palette directly. Fixes #26056. (cherry picked from commit cfdfa9a)
@crisbeto when the fix will be avaible? |
It will be in the release next week. |
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. |
Is this a regression?
The previous version in which this bug was not present was
13.x
Description
When using a custom theme the contrast values from a custom palette are not applied
Reproduction
steps
example:
https://stackblitz.com/edit/angular-5b8rw5?file=src/theme.scss
Expected Behavior
Text in accent button should be white (contrast color) as specified in the palette
Actual Behavior
Text in accent button is black
Environment
The text was updated successfully, but these errors were encountered: