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

Fix nav placeholder colors and height. #31875

Merged
merged 1 commit into from
May 17, 2021
Merged
Changes from all commits
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
27 changes: 19 additions & 8 deletions packages/block-library/src/navigation/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ $color-control-label-height: 20px;
.components-placeholder__fieldset .components-button {
margin-bottom: 0;
}

// For the placeholder indicators to colorize correctly, colors need to be inherited unless selected.
color: inherit;

.is-selected & {
color: $gray-900;
}
}

// Spinner.
Expand Down Expand Up @@ -225,20 +232,24 @@ $color-control-label-height: 20px;
opacity: 0.3;
}

// Don't show the preview boxes for an empty nav block.
// Needs specificity to work for the navigation screen.
.wp-block-navigation.is-selected &.wp-block-navigation-placeholder__preview {
display: none;
}

// ... but be present in larger contexts to size it correctly.
.wp-block-navigation.is-selected .is-large & {
// Don't show the preview boxes for an empty nav block,
// but be technically present to help size the empty state.
.wp-block-navigation.is-selected & {
display: flex;
opacity: 0;
width: 0;
overflow: hidden;
flex-wrap: nowrap;
}

// .. but hide entirely when the placeholder can still be toggled.
.wp-block-navigation.is-selected .is-small & {
display: none;
}

.wp-block-navigation.is-selected .is-medium & {
display: none;
}
}

// Selected state.
Expand Down