Skip to content
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

MdMenu : style mat-menu-panel #5870

Closed
clement-hollander opened this issue Jul 19, 2017 · 5 comments · Fixed by #5873
Closed

MdMenu : style mat-menu-panel #5870

clement-hollander opened this issue Jul 19, 2017 · 5 comments · Fixed by #5873
Assignees

Comments

@clement-hollander
Copy link

According to https://material.io/guidelines/material-design/elevation-shadows.html, Desktop resting elevation is 2dp below the listed values to accommodate mouse and non-touch environments.

For sample in the MdMenu component, we are unable to apply a mat-elevation-z6 class to the mat-menu-panel

@crisbeto
Copy link
Member

crisbeto commented Jul 19, 2017

You can set a class on the md-menu element, although the mat-elevation-z6 won't have an effect, because it's higher in the stylesheet than the mat-menu-panel. You can work around it by defining your own class that has a higher specificity. I'll see what I can do to make the overrides a little easier in the future.

That being said, you're right that the elevation seems to be wrong now. When I re-adjusted it last time, I must've been looking at the one for mobile. I'll switch it back to 8.

@clement-hollander
Copy link
Author

thanks @crisbeto, it should be great to have a mixin for desktop use, where all elevations are minus 2.

8 is mobile menu by the way ;)

@crisbeto
Copy link
Member

FWIW, you can generate your own elevations via the mat-elevation mixin, You can see how the default ones are defined here.

@crisbeto crisbeto self-assigned this Jul 19, 2017
crisbeto added a commit to crisbeto/material2 that referenced this issue Jul 19, 2017
Makes it a little easier to override the elevation of the `.mat-menu-panel`. Previously it wasn't possible to apply the `mat-elevation-z*` classes directly, because the elevation styles are defined earlier in the stylesheet than the menu styles.

Fixes angular#5870.
kara pushed a commit that referenced this issue Jul 20, 2017
Makes it a little easier to override the elevation of the `.mat-menu-panel`. Previously it wasn't possible to apply the `mat-elevation-z*` classes directly, because the elevation styles are defined earlier in the stylesheet than the menu styles.

Fixes #5870.
@willshowell
Copy link
Contributor

willshowell commented Jul 28, 2017

@crisbeto While #5873 does make it easier to override, I think part of the original issue remains.

The spec says menu elevations should be 6dp on desktop and 8dp on mobile, but the default is currently 2dp.

EDIT: nvm, there's an inconsistency between the menu guidelines (2dp) and the elevation guidelines (6dp)

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants