You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
VILLAN3LL3
changed the title
bug(COMPONENT): css variables get lost when using multiple themes in angular material
bug(angular material): css variables get lost when using multiple themes in angular material
Dec 20, 2024
I don't think it's an issue, it's how you're applying theme to app-root. You need specifically give background to app-root when changing theme. For example, in your index.html file, you can add class mat-app-background with app-root. Plus app-root should be set to display: block.
It's because overlays are added in body, not in app-root. For example if you add @include mat.all-component-colors($light-theme); after @include mat.all-component-typographies($base-theme);, you will see light-themed tooltip always.
I would suggest to move theming from app-root to body or html.
Is this a regression?
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:
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
The text was updated successfully, but these errors were encountered: