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

Navigation: Try adding minimal animation to overlay. #43851

Merged
merged 1 commit into from
Sep 6, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion packages/block-library/src/navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,16 @@ button.wp-block-navigation-item__content {
* Mobile menu.
*/

@keyframes overlay-menu__fade-in-animation {
from {
opacity: 0;
top: 0.5em;
}
to {
opacity: 1;
top: 0;
}
}
.wp-block-navigation__responsive-container {
display: none;
position: fixed;
Expand Down Expand Up @@ -468,6 +478,11 @@ button.wp-block-navigation-item__content {
flex-direction: column;
background-color: inherit;

// Animation.
animation: overlay-menu__fade-in-animation 0.1s ease-out;
animation-fill-mode: forwards;
@include reduce-motion("animation");

// Try to inherit any root paddings set, so the X can align to a top-right aligned menu.
padding-top: var(--wp--style--root--padding-top, 2rem);
padding-right: var(--wp--style--root--padding-right, 2rem);
Expand Down Expand Up @@ -675,7 +690,8 @@ button.wp-block-navigation-item__content {
}

// Adjust open dialog top margin when admin-bar is visible.
.has-modal-open .admin-bar .wp-block-navigation__responsive-dialog {
// Needs to be scoped to .is-menu-open, or it will shift the position of any other navigations that may be present.
.has-modal-open .admin-bar .is-menu-open .wp-block-navigation__responsive-dialog {
margin-top: $admin-bar-height-big;

// Handle smaller admin-bar.
Expand Down