I want to add my own custom colors, similar to "primary", "warn" etc. For example, I added a class for an orange background, but I use it as a class and not as a color attribute. It works, but the code looks a bit confusing.
<button md-raised-button color="primary" class="btn-w-md ml-3 orange-500-bg"> <i class="material-icons">description</i> Deactivate </button>
What do I need to do to add it as color="orange"
?
To change the color of mat-button color use color property. We can change the background color to primary, accent, or warn.
In the ChangeColor() function, we call another function Change2(). This function is used to change the color of the button again.
The color of a <mat-toolbar> can be changed by using the color property. By default, toolbars use a neutral background color based on the current theme (light or dark). This can be changed to 'primary' , 'accent' , or 'warn' .
A theme is a collection of color and typography options. Each theme includes three palettes that determine component colors: A primary palette for the color that appears most frequently throughout your application. An accent, or secondary, palette used to selectively highlight key parts of your UI.
You can add any color like below
<a mat-mini-fab color="success" routerLink=".">link</a>
.mat-success { background-color: green; color: #fff; }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With