-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug(experimental): missing box-shadow css rule on elevated containers with material 3 theme #28618
Comments
My main concern is that not even the Angular Material guides reflect the fact they got removed. The example https://material.angular.io/guide/elevation does a toggle that ends up not making any difference. |
Yeah, this is a breaking change that has not been documented. IMO, it should get a higher priority, since it breaks many applications that depends on this feature/behavior. |
Fixes that we didn't support elevation classes in M3 which was breaking some users. Fixes angular#28618.
Fixes that we didn't support elevation classes in M3 which was breaking some users. Fixes angular#28618.
Fixes that we didn't support elevation classes in M3 which was breaking some users. Fixes angular#28618.
Fixes that we didn't support elevation classes in M3 which was breaking some users. Fixes #28618.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Is this a regression?
The previous version in which this bug was not present was
No response
Description
Hi ✋
In the current implementation of the experimental Material 3 themes, the
mat-elevation-z*
CSS classes lack thebox-shadow
rule. It appears to be a deliberate design choice, as Material 3 themes exclusively generate CSS custom variables.To address this issue, we have two potential solutions:
SCSS Mixin Approach:
Add an SCSS mixin that generates all
mat-elevation-z*
classes from 0 to 24, applying the necessarybox-shadow
rules. Here's an example of the mixin:Directive Update Approach:
Remove the usage of
mat-elevation-z*
classes in all directives (e.g.,mat-menu
), replacing them with thebox-shadow
CSS rule. Utilize a CSS custom property for flexibility, such as:Additional Suggestion:
Introduce a theme API,
mat.get-shadow
, which returns thebox-shadow
for a given elevation value. This API would function similarly to the existingmat.elevation(x)
mixin but solely returns the value without applying it.These enhancements aim to provide flexibility and address the missing
box-shadow
rule in a manner consistent with the Material 3 design choices.Reproduction
StackBlitz link: https://stackblitz.com/edit/components-issue-n9d5rj
Steps to reproduce:
Expected Behavior
Elevated containers such like opened menu panels should have a shadow
Actual Behavior
No shadow
Environment
The text was updated successfully, but these errors were encountered: