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

Navigation: Enable even more compact setup state. #37089

Merged
merged 1 commit into from
Dec 28, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
26 changes: 18 additions & 8 deletions packages/block-library/src/navigation/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,6 @@ $color-control-label-height: 20px;

// Selected state.
.wp-block-navigation-placeholder__controls {
padding: $grid-unit-10;
border-radius: $radius-block-ui;
background-color: $white;
box-shadow: inset 0 0 0 $border-width $gray-900;
Expand All @@ -301,11 +300,7 @@ $color-control-label-height: 20px;
display: none;
position: relative;
z-index: 1;

// Adjust padding for when shown horizontally.
.is-large & {
padding: $grid-unit-05 $grid-unit-10;
}
padding: $grid-unit-05 $grid-unit-10;

// If an ancestor has a text-decoration property applied, it is inherited regardless of
// the specificity of a child element. Only pulling the child out of the flow fixes it.
Expand All @@ -318,9 +313,19 @@ $color-control-label-height: 20px;
display: flex;
}

// Show stacked for the vertical navigation, or small placeholders.
.is-small &,
// Hide a few elements in medium size placeholders.
// @todo: part of the code here will be irrelevant if https://github.com/WordPress/gutenberg/pull/36775 lands.
.is-medium & {
.wp-block-navigation-placeholder__actions__indicator,
.wp-block-navigation-placeholder__actions__indicator + hr,
.wp-block-navigation-placeholder__actions > :nth-last-child(3), // Add all pages.
.wp-block-navigation-placeholder__actions > :nth-last-child(2) { // hr separator after it.
display: none;
}
}

// Show stacked for the vertical navigation, or small placeholders.
.is-small & {
.wp-block-navigation-placeholder__actions {
flex-direction: column;
}
Expand Down Expand Up @@ -354,6 +359,11 @@ $color-control-label-height: 20px;
}
}

// Keep as row for medium.
.wp-block-navigation .components-placeholder.is-medium .components-placeholder__fieldset {
flex-direction: row !important;
}

.wp-block-navigation-placeholder__actions {
display: flex;
font-size: $default-font-size;
Expand Down