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

Try: Increase specificity of horizontal block margins. #30337

Closed
wants to merge 1 commit into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@

// Add a little left margin when used horizontally.
// The right margin should be set to auto, so as to not shift layout in flex containers.
margin: 0 auto 0 $grid-unit-10;
// This needs specificity for non-block-themes.
&,
.edit-post-layout:not(.supports-layout) & {
margin: 0 auto 0 $grid-unit-10;
}

// ... unless it's the only child.
&:first-child {
Expand Down
15 changes: 11 additions & 4 deletions packages/block-library/src/buttons/editor.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,27 @@ $blocks-block__margin: 0.5em;

.wp-block-buttons {
> .wp-block {
// Override editor auto block margins.
margin-left: 0;
margin-top: $blocks-block__margin;
margin-right: $blocks-block__margin;

&,
.edit-post-layout:not(.supports-layout) & {
// Override editor auto block margins.
margin-left: 0;
margin-top: $blocks-block__margin;
margin-right: $blocks-block__margin;
}
}

> .block-list-appender {
display: inline-flex;
align-items: center;
}

&.is-vertical {
> .block-list-appender .block-list-appender__toggle {
justify-content: flex-start;
}
}

> .wp-block-button {
&:focus {
box-shadow: none;
Expand Down