Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Overwrite CSS variables from Angular Material 15

The new Angular Material 15 has some "breaking" changes in regards of the colors and spacing. Therefore I need to overwrite the default values of the CSS variables. I define in my styles.scss

:root {
    --mdc-typography-button-letter-spacing: 'normal';
    --mdc-dialog-supporting-text-color: mat.get-color-from-palette($greyPalette, 900);
}

While the first variable is undefined and therefore the definition is taken the second variable has a value but is not overwritten.

So, how to set the variable properly?

like image 804
LeO Avatar asked Jun 26 '26 18:06

LeO


1 Answers

This worked for me:

:root {
    --mdc-typography-button-letter-spacing: 'normal';
    --mdc-dialog-supporting-text-color: #{map-get($myPalette, 300)};
}
like image 137
Nina Avatar answered Jun 28 '26 11:06

Nina



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!