Skip to content

Commit

Permalink
Bringing back submenu arrows and hiding submenus unless the parent li…
Browse files Browse the repository at this point in the history
…nk is selected.
  • Loading branch information
shaunandrews committed Feb 5, 2021
1 parent 78ecaca commit c36468a
Showing 1 changed file with 20 additions and 11 deletions.
31 changes: 20 additions & 11 deletions packages/edit-navigation/src/components/editor/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -43,30 +43,39 @@

.wp-block-navigation-link__label {
padding: $grid-unit-15;
padding-left: $grid-unit-30;

// Without this, Links with submenus display a pointer.
// Without this Links with submenus display a pointer.
cursor: text;
}

// Hide the submenu icons
.wp-block-navigation-link__submenu-icon {
display: none;
// Position the submenu icon so it appears to the left of
// the Link. All the extra specificity is help override the
// rotation on the SVG.
.wp-block-navigation .wp-block-navigation-link .wp-block-navigation-link__submenu-icon {
position: absolute;
top: 6px;
left: 2px;
padding: 6px;
pointer-events: none;

svg {
padding: 0;
transform: rotate(90deg);
}
}

// Submenus
// There's a bunch of stuff to override just to get submenus to
// as a normal block element.
.wp-block-navigation-link.has-child {
cursor: default;
border-radius: $radius-block-ui;
}

// Highlight the parent while editing a child block.
// When editing a link with children, highlight the parent
// and adjust the spacing and submenu icon.
.wp-block-navigation-link.has-child.is-editing {
box-shadow: 0 0 0 1px $gray-400;
border-radius: $radius-block-ui;
padding: $grid-unit-05;
margin: 0 0 $grid-unit-05 -$grid-unit-05;

> .wp-block-navigation__container {
opacity: 1;
visibility: visible;
Expand All @@ -88,7 +97,7 @@

// Add Buttons
.block-editor-button-block-appender.block-list-appender__toggle {
margin: 0;
margin: 0 0 0 $grid-unit-20;
padding: 0;
}
}

0 comments on commit c36468a

Please sign in to comment.