In the official theming documentation of Angular Material2 it states clearly the following:
In Angular Material, a theme is created by composing multi
The guide is available at the documentation website located here.
First, you define the palettes for your theme, such as $primary
, $accent
, $warn
(in the guide they have $candy-app-
prefix) and then create a $theme
object:
// Create the theme object (a Sass map containing all of the palettes).
$theme: mat-light-theme($primary, $accent, $warn);
Once we have a theme that contains all the palettes, we can get a foreground palette from it:
$foreground: map-get($theme, foreground);
From $foreground
palette we can get any values based on a key, such as
secondary-text: rgba(black, 0.54),
or
text: rgba(black, 0.87)
Here's the code to retrieve the secondary-text
property:
color: mat-color($foreground, secondary-text);
I switched to 2.0.0-beta.3
from 2.0.0-beta.2
and the folders structure looks different, you are right.
It is now \node_modules\@angular\material\_theming.scss
, _palette.scss
file is gone. You can do global search for it though: '$mat-dark-theme-background: ('
_theming.scss
has all the colors, maps and all the functions, like mat-color