Skip to content

bug(angular material): css variables get lost when using multiple themes in angular material #30221

@VILLAN3LL3

Description

@VILLAN3LL3

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

No response

Description

using light and dark theme leads to lost styles and css variables

Reproduction

StackBlitz link: https://stackblitz.com/edit/stackblitz-starters-ajqpjxrh?file=src%2Fmain.ts
Steps to reproduce:

  1. press "change theme".
  2. check the stylings (tool tip submit button + click on menu button + styling of mat card header, ...)

Expected Behavior

everything is styled properly in light or dark mode

Actual Behavior

some styles don't seem to be set correctly. See for example the menu overlay or the submit button tooltip. It seems that css variables have been lost, for example --mat-menu-container-shape.

Environment

  • Angular: ^18.2
  • CDK/Material: ^18.2
  • Browser(s): n/a
  • Operating System (e.g. Windows, macOS, Ubuntu): n/a

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs triageThis issue needs to be triaged by the team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions