-
Notifications
You must be signed in to change notification settings - Fork 6.7k
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
mixinColor: Allow custom colors #19134
Comments
As per Material Design specification, there is only a primary, secondary and error palette. Obviously our palette is named We cannot add another option to Generally though, this is a great issue though! Please keep us updated when you find a way to achieve a fourth palette. It might be worth experimenting with TS declaration merging (though that might not play nicely w/ type checking) |
I may have got this to work (not fully tested).
If I make all my variables use my definition instead of materials. The only issue i see is there is no clean way to do:
because it will by default use materials definition and not mine. (unless I can find a way to globally apply it.
|
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. |
Feature Description
Add
error
as a validThemePalette
or better yet, provide a way to create custom Palette colors.
Use Case
Years ago I had the need to have a color="error" that was different than color="warn".
To accomplish this I have created scss library that creates all the css needed on all the material components to support the error color.
Here is an example of what I am talking about: https://stackblitz.com/edit/error-button-color
It works in stackblitz due to this bug: stackblitz/core#220
With Angular9 and this setting turned on (in the tsconfig.json):
it returns this error:
A third option (that I have not figured out) is can you override the ThemePalettte type definition?
The text was updated successfully, but these errors were encountered: