-
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
feat(menu): increase nested menu elevation based on depth #5937
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just nits. Apply label when ready.
src/lib/menu/menu-directive.ts
Outdated
@@ -62,8 +63,8 @@ export class MdMenu implements AfterContentInit, MdMenuPanel, OnDestroy { | |||
/** Current state of the panel animation. */ | |||
_panelAnimationState: 'void' | 'enter-start' | 'enter' = 'void'; | |||
|
|||
/** Whether the menu is a sub-menu or a top-level menu. */ | |||
isSubmenu: boolean = false; | |||
/** Parent menu os the current menu panel. */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo: os
-> of
src/lib/menu/menu-directive.ts
Outdated
@@ -181,6 +182,25 @@ export class MdMenu implements AfterContentInit, MdMenuPanel, OnDestroy { | |||
this._classList['mat-menu-below'] = posY === 'below'; | |||
} | |||
|
|||
/** | |||
* Sets the menu panel elevation. | |||
* @param depth Amount of parent menus that come before the menu. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: Amount of parent menus
-> Number of parent menus
(sounds more natural)
src/lib/menu/menu-directive.ts
Outdated
*/ | ||
setElevation(depth: number): void { | ||
// The elevation starts at 2 and increases by one for each level. | ||
const newElevation = `mat-elevation-z${depth + 2}`; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we make the starting elevation a constant? Like MD_MENU_BASE_ELEVATION
389d174
to
e8d08d1
Compare
e8d08d1
to
f9054c8
Compare
Please rebase |
Increases the sub-menu elevation, based on its depth. [Spec for reference](https://material.io/guidelines/material-design/elevation-shadows.html)
f9054c8
to
9c319f3
Compare
Rebased @andrewseguin. |
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. |
Increases the sub-menu elevation, based on its depth. Spec for reference