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

Block Library - Navigation: Fix arrow inheritance, polish #30287

Merged
merged 2 commits into from
Mar 29, 2021
Merged
Show file tree
Hide file tree
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
3 changes: 2 additions & 1 deletion packages/block-library/src/navigation-link/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
*/

// Show submenus above the sibling inserter.
.has-child {
.wp-block-navigation .has-child {
cursor: pointer;

.submenu-container,
.wp-block-navigation-link__container {
z-index: z-index(".has-child .wp-block-navigation-link__container");
}
Expand Down
6 changes: 1 addition & 5 deletions packages/block-library/src/navigation-link/icons.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ export const ItemSubmenuIcon = () => (
viewBox="0 0 12 12"
fill="none"
>
<Path
d="M1.50002 4L6.00002 8L10.5 4"
stroke="#000000"
strokeWidth="1.5"
/>
<Path d="M1.50002 4L6.00002 8L10.5 4" strokeWidth="1.5" />
</SVG>
);
2 changes: 1 addition & 1 deletion packages/block-library/src/navigation-link/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function block_core_navigation_link_build_css_font_sizes( $context ) {
* @return string
*/
function block_core_navigation_link_render_submenu_icon() {
return '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke="#000000" stroke-width="1.5"></path></svg>';
return '<svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" role="img" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg>';
}

/**
Expand Down
17 changes: 13 additions & 4 deletions packages/block-library/src/navigation-link/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@
}
}

// Margin when justified right or space-between.
.wp-block-navigation__container > .wp-block-pages-list__item:last-child,
.wp-block-navigation__container > .wp-block-navigation-link:last-child {
margin-right: 0;
}

// Menu item link.
.wp-block-pages-list__item__link,
.wp-block-navigation-link__content {
Expand Down Expand Up @@ -82,7 +88,6 @@

.submenu-container,
.wp-block-navigation-link__container {
border: 1px solid rgba(0, 0, 0, 0.15);
background-color: inherit;
color: inherit;
position: absolute;
Expand Down Expand Up @@ -115,13 +120,11 @@
}

@include break-medium {
left: 1.5em;

// Nested submenus sit to the left on large breakpoints.
.submenu-container,
.wp-block-navigation-link__container {
left: 100%;
top: -$border-width;
top: 0;

// Prevent the menu from disappearing when the mouse is over the gap
&::before {
Expand Down Expand Up @@ -190,5 +193,11 @@
// several times, so care needs to be taken.
background-color: #fff;
color: #000;
border: 1px solid rgba(0, 0, 0, 0.15);

.submenu-container,
.wp-block-navigation-link__container {
top: -1px;
}
}
}