Skip to content

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.

Color palettes are generated with the Material Generator. The Angular CLI provides the following command:

Terminal window
ng generate @angular/material:theme-color

In the global stylesheet of your shell client:


styles.scss
@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();

styles.scss
@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 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
styles.scss
@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();
styles.scss
@use '@yuuvis/material/scss' as ymt;
@include ymt.global-styles();
@include mat.card-overrides((
elevated-container-color: red,
title-text-size: 2rem
));
styles.scss
@use '@yuuvis/material/scss' as ymt;
@include ymt.global-styles();
@include ymt.token-overrides((
brand: mediumpurple,
surface-app: lavender
));