Theming in the shell
Theming in our system exclusively refers to the definition of colors and typography, as provided by Angular Material. Other areas such as density adjustments, which are mentioned in the Angular Material documentation, are not supported in our setup.
It is important to clearly distinguish theming from overrides:
- Theming updates token values according to defined color palettes and typography configurations.
- Overrides are semantic reassignments of tokens (Material System Tokens or Ymt Tokens). They allow for adjustments but are no longer considered classic theming.
Colors
Section titled “Colors”Color palettes are generated with the Material Generator. The Angular CLI provides the following command:
ng generate @angular/material:theme-colorIn the global stylesheet of your shell client:
@use '@yuuvis/material/scss' as ymt;
$new-palettes: ( primary: (generated values), secondary: (generated values), tertiary: (generated values), neutral: (generated values), neutral-variant: (generated values), error: (generated values), success: (generated values), warning: (generated values),);
$new-theme: ( color: $new-palettes);
// adjust theme before loading global styles@include ymt.theme($new-theme);@include ymt.global-styles();Typography
Section titled “Typography”@use '@yuuvis/material/scss' as ymt;
$new-theme: ( typography: ( plain-family: Helvetica, brand-family: Helvetica, bold-weight: 700, medium-weight: 500, regular-weight: 400 ));
// adjust theme before loading global styles@include ymt.theme($new-theme);@include ymt.global-styles();Overrides
Section titled “Overrides”Overrides are semantic reassignments of tokens and are not considered classic theming. There are three relevant levels:
- Material System Token Overrides – adjustments to Material System Tokens
- Material Component Token Overrides – adjustments to Material Component Tokens
- YMT System Token Overrides – adjustments to the custom YMT Tokens
Material System Token
Section titled “Material System Token”@use '@yuuvis/material/scss' as ymt;
$new-mat-sys-token-overrides: ( 'outline': black);
@include ymt.theme((), $new-mat-sys-token-overrides);@include ymt.global-styles();Material Component Token
Section titled “Material Component Token”@use '@yuuvis/material/scss' as ymt;
@include ymt.global-styles();@include mat.card-overrides(( elevated-container-color: red, title-text-size: 2rem));Ymt System Token
Section titled “Ymt System Token”@use '@yuuvis/material/scss' as ymt;
@include ymt.global-styles();@include ymt.token-overrides(( brand: mediumpurple, surface-app: lavender));