Skip to content

Commit

Permalink
Centrally align the chevron
Browse files Browse the repository at this point in the history
  • Loading branch information
jameskoster authored and gwwar committed Jun 11, 2021
1 parent 92f353c commit c36de9e
Showing 1 changed file with 34 additions and 5 deletions.
39 changes: 34 additions & 5 deletions packages/block-editor/src/components/block-navigation/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -284,21 +284,50 @@
.block-editor-block-navigation__expander {
height: $icon-size;
margin-left: $grid-unit-05;
width: $icon-size - $grid-unit-05;
width: $icon-size;
}

// First level of indentation is aria-level 2, max indent is 8.
// Indent is a full icon size, plus 4px which optically aligns child icons to the text label above.
$block-navigation-max-indent: 8;
.block-editor-block-navigation-leaf[aria-level] .block-editor-block-navigation__expander {
margin-left: ( $grid-unit-30 + $grid-unit-05 ) * $block-navigation-max-indent;
margin-left: ( $grid-unit-30 ) * $block-navigation-max-indent;
}
@for $i from 0 through $block-navigation-max-indent {
.block-editor-block-navigation-leaf[aria-level="#{ $i + 1 }"] .block-editor-block-navigation__expander {
margin-left: ( $grid-unit-30 + $grid-unit-05 ) * $i;

.block-editor-block-navigation-leaf:not([aria-level="1"]) {
.block-editor-block-navigation__expander {
margin-right: 4px;
}
}

.block-editor-block-navigation-leaf[aria-level="1"] .block-editor-block-navigation__expander {
margin-left: 0;
}

.block-editor-block-navigation-leaf[aria-level="2"] .block-editor-block-navigation__expander {
margin-left: 24px;
}

.block-editor-block-navigation-leaf[aria-level="3"] .block-editor-block-navigation__expander {
margin-left: 52px;
}

.block-editor-block-navigation-leaf[aria-level="4"] .block-editor-block-navigation__expander {
margin-left: 80px;
}

.block-editor-block-navigation-leaf[aria-level="5"] .block-editor-block-navigation__expander {
margin-left: 108px;
}

.block-editor-block-navigation-leaf[aria-level="6"] .block-editor-block-navigation__expander {
margin-left: 136px;
}

.block-editor-block-navigation-leaf[aria-level="7"] .block-editor-block-navigation__expander {
margin-left: 164px;
}

.block-editor-block-navigation-leaf .block-editor-block-navigation__expander {
visibility: hidden;
}
Expand Down

0 comments on commit c36de9e

Please sign in to comment.