Closed
Description
Is this a regression?
- Yes, this behavior used to work in the previous version
The previous version in which this bug was not present was
13.x
Description
When using a custom theme the contrast values from a custom palette are not applied
Reproduction
steps
- define a custom palette with a "slightly light" color and a white contrast color
$md-secondary: (
...
500 : #f86072,
...
contrast: (
...
500 : #ffffff
...
)
);
- Apply the theme
$theme-primary: mat.define-palette($md-primary,500);
$theme-accent: mat.define-palette($md-secondary,500);
$theme-warn: mat.define-palette(mat.$red-palette);
$theme: mat.define-light-theme((
color: (
primary: $theme-primary,
accent: $theme-accent,
warn: $theme-warn,
),
typography: mat.define-typography-config(),
));
@include mat.all-component-themes($theme);
example:
https://stackblitz.com/edit/angular-5b8rw5?file=src/theme.scss
Expected Behavior
Text in accent button should be white (contrast color) as specified in the palette
Actual Behavior
Text in accent button is black
Environment
- Angular:15.0.0
- CDK/Material:15.0.0
- Browser(s):chrome, safari
- Operating System (e.g. Windows, macOS, Ubuntu):Ubuntu