Angular Mat Colors
First of let s take a look at the angular material color palette to understand how it works.
Angular mat colors. To generate a color palette we can use angular material s mat palette mix in. What you shouldn t do. Angular material theme definition file. Generating angular material custom color palette.
My first attempt was to create the color variables in the theme scss directly that s wrong because it would include mat core and angular material theme every time we. You can find theming file here. In component css file declared class selector by changing background color and font color. The next thing we need to do is to generate color palettes which can then be composed to an actual theme.
This is how color palettes are defined in angular material. Mat palette takes a base palette yes that s another palette more on that in a second and returns a new palette that comes with material specific hue color values for light. Creating custom angular material color palette. The numbers behind the palette variable name select particular shades of chosen color for default lighter and darker variants if no numbers are provided.
Install with bower install with npm view source on github doc humanizedoc directivebrackets doc restrict doc humanizedoc directivebrackets view demo view source on github. New colors for buttons can be submitted simply by using the mat prefix on our custom color class.