Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use a theme color from Angular Material prebuilt themes

I would like to use a specific color from the material theme in my css.

For example

.my_tab_group {
  border: 1px solid $some_color_from_theme;
}

Does Angular Material expose different color shades via some variable, so that I can use in my own .scss file (e.g., like using $some_color_from_theme above)?

like image 357
Nehal Damania Avatar asked Mar 21 '18 08:03

Nehal Damania


1 Answers

You must Import ~@angular/material/theming in your sass file.

Then in your case you can write something like that:

.my_tab_group {
  border: 1px solid map-get($mat-light-theme-background, 'dividers');
}

Check the doc: https://material.angular.io/guide/theming-your-components

like image 187
Alexandre Annic Avatar answered Sep 30 '22 16:09

Alexandre Annic