Skip to content

Commit

Permalink
Navigation: Fix arrow inheritance, polish
Browse files Browse the repository at this point in the history
  • Loading branch information
jasmussen committed Mar 29, 2021
1 parent d989f56 commit 6aa8e28
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
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
11 changes: 7 additions & 4 deletions packages/block-library/src/navigation-link/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,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 +114,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 +187,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;
}
}
}

0 comments on commit 6aa8e28

Please sign in to comment.