-
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
feat(theme-generator): Add possibility to force custom color @angular/material:theme-color #30167
Comments
Very big +1. The fact that you cannot provide exact colors to an M3 theme is a deal breaker for me. Not being able to use my company's brand colors just because they aren't "up to Material's standards" just feels wrong. I know I can manually override every color variable, and I will do so when support for M2 gets dropped eventually, but this is just very annoying and I really hope there will be an easier way to use exact colors for a theme. |
@zygarios For each color specified, those colors are used directly to create color palettes of tones that match that color's hue and chroma. If you only specify a single color or a subset, the other colors get created in relation to each other. So there shouldn't be much adjusting happening if you specify everything and aren't requesting high contrast. Although, Material defines Although I do see what you are saying, it would be ideal if you can specify maybe the In the meantime, overriding colors is your best option for complete customization: https://material.angular.io/guide/theming#system-tokens |
This is a very blocking issue right now. An example (a very ugly primary color but just to let you see the difference): @amysorto overriding the colors isn't the best option, because we don't know the text contrast colors An example for changing the mat-toolbar
we should have someting like this #30070 so we can use
But then I'm still missing my brand color |
For those interested, I've created a small function which sets all theme tones to css vars, which you can use in your own color palette
First you need to My code is just a little change from what the scheme does Offcourse not an ideal thing to do, but now I can set a brand color to tone 40 and I have all tones as css variables from one hex value. |
Feature Description
My problem is that I still can't understand how
@angular/material:theme-color
works. In the terminal, I need to provide colors for primary, secondary, and tertiary. For each one, I specify a single color, like #ff9500, because that's what I want.What HEX color should be used to generate the M3 theme? It will represent your primary color palette. (ex. #ffffff) **#005dba** What HEX color should be used represent the secondary color palette? (Leave blank to use generated colors from Material) **#005dba** What HEX color should be used represent the tertiary color palette? (Leave blank to use generated colors from Material) **#005dba**
However, when generating the theme, I see that it creates color palettes, but when I try to get just my color, I use
--mat-sys-primary
. Unfortunately, it appears significantly darker (#8c5000), and I don't know which variable the color is actually hidden under. I have the impression that due to the low contrast, it is being artificially darkened. However, I selected the option not to generate mixins with high contrast. I would like to be able to use exactly that color without worrying about contrast. Currently, I am forced to manually change all the system token colors because the generated palette still interferes too much with what I want to achieve, taking away the flexibility I need in this case.Use Case
It would be great to be able to specify in the terminal that I want exactly the colors I mention, without any interference.
The text was updated successfully, but these errors were encountered: