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

WIP sub nav fixes for navigation block #18382

Closed
wants to merge 1 commit into from
Closed
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
52 changes: 40 additions & 12 deletions packages/block-library/src/navigation-menu/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,16 @@

& > a {
padding-left: 0;
text-decoration: none;

@include break-small {
padding-left: 16px;
}
}

& > a:hover {
padding-left: 0;
text-decoration: underline;

@include break-small {
padding-left: 16px;
Expand All @@ -59,19 +69,43 @@

// Sub-menus Flyout
& > li > ul {
margin: 0;
position: absolute;
background: #fff;
box-shadow: 0 0 8px 2px rgba(0, 0, 0, 0.2);
background: #000;
border-radius: 0.4rem;
left: 0;
top: 100%;
margin: 0;
min-width: max-content;
opacity: 0;
transition: all 0.5s ease;
position: absolute;
top: calc(100% + 1rem);
transition: opacity 0.15s linear, transform 0.15s linear, right 0s 0.15s;
transform: translateY(0.6rem);
visibility: hidden;

&::before {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of these styles should likely be added within the theme.scss styles, which is what gets loaded when a theme does add_theme_support( 'wp-block-styles' ). Particularly the ones that are harder to replace, like ::before.

border: solid transparent;
border-color: rgba(0, 0, 0, 0);
border-bottom-color: #000;
border-width: 10px;
bottom: 100%;
content: " ";
height: 0;
left: 20%;
margin-left: -10px;
width: 0;
position: absolute;
pointer-events: none;
}

li {
margin: 0;
}

ul {
width: 100%;

li {
margin: 0.5rem 0 0 2rem;
}
}
}
}
Expand All @@ -95,12 +129,6 @@
padding-top: 8px;
padding-bottom: 8px;

&::before {
// Increment the dashes
counter-increment: nested-list;
// Insert dashes with spaces in between
content: "\2013\00a0" counters(nested-list, "\2013\00a0", none);
}
}
}

Expand Down