Components: Support styling native anchor elements via theming system

Created on 17 Aug 2017  路  2Comments  路  Source: angular/components

P4 theming feature needs discussion

Most helpful comment

I could see the use in having a generic way to apply theme colors to arbitrary elements.

You can add styles for this yourself right now with the theming API. It would look something like:
(inside a theme file)

// Include non-theme styles for core.
@include mat-core();

// Define a theme.
$primary: mat-palette($mat-indigo);
$accent:  mat-palette($mat-pink, A200, A100, A400);

$theme: mat-light-theme($primary, $accent);

// Include all theme styles for the components.
@include angular-material-theme($theme);

// Custom style for my anchor elements
a {
  color: mat-color($accent);
}

All 2 comments

I could see the use in having a generic way to apply theme colors to arbitrary elements.

You can add styles for this yourself right now with the theming API. It would look something like:
(inside a theme file)

// Include non-theme styles for core.
@include mat-core();

// Define a theme.
$primary: mat-palette($mat-indigo);
$accent:  mat-palette($mat-pink, A200, A100, A400);

$theme: mat-light-theme($primary, $accent);

// Include all theme styles for the components.
@include angular-material-theme($theme);

// Custom style for my anchor elements
a {
  color: mat-color($accent);
}

I could see the use in having a generic way to apply theme colors to arbitrary elements.

@jelbourn : Would this be something like this https://material.angularjs.org/latest/api/directive/mdColors ?

Was this page helpful?
0 / 5 - 0 ratings