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 navigation block placeholder preview markup #33963

Merged
merged 2 commits into from
Aug 10, 2021
Merged
Show file tree
Hide file tree
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
17 changes: 13 additions & 4 deletions packages/block-library/src/navigation/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,16 @@ $color-control-label-height: 20px;
}
}

svg {
fill: currentColor;
.wp-block-navigation-placeholder__preview-search-icon {
height: $icon-size;
svg {
fill: currentColor;
}
}


.wp-block-navigation-link.wp-block-navigation-link,
svg {
.wp-block-navigation-placeholder__preview-search-icon {
opacity: 0.3;
}

Expand All @@ -248,7 +252,12 @@ $color-control-label-height: 20px;
flex-wrap: nowrap;
}

// .. but hide entirely when the placeholder can still be toggled.
// Hide entirely when vertical.
.is-vertical.is-selected & {
display: none;
}

// Hide entirely when the placeholder can still be toggled.
.wp-block-navigation.is-selected .is-small & {
Copy link
Contributor

Choose a reason for hiding this comment

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

When is this is-small class added? Having display: none on the placeholder when the block is selected, for either horizontal or vertical, doesn't seem to make any difference visually, so I must be missing something here 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for reviewing. I can't see what this does either 🤔

Maybe it can be removed.

display: none;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ const PlaceholderPreview = () => {
<li className="wp-block-navigation-link">&#8203;</li>
<li className="wp-block-navigation-link">&#8203;</li>
<li className="wp-block-navigation-link">&#8203;</li>
<Icon icon={ search } />
<li className="wp-block-navigation-placeholder__preview-search-icon">
<Icon icon={ search } />
</li>
</ul>
);
};
Expand Down