Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
use scss for loop
  • Loading branch information
gwwar committed May 21, 2021
commit e5c2be34da74e3c029d886308892f97fde3efc1a
Original file line number Diff line number Diff line change
Expand Up @@ -276,32 +276,13 @@

// First level of indentation is aria-level 2, max indent is 8.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we use a SCSS for loop for this one?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good call I added this in e5c2be3

Generated final CSS looks like:
Screen Shot 2021-05-21 at 8 57 24 AM

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