Skip to content

Conversation

jasmussen
Copy link
Contributor

This fixes #7812, though in a somewhat heavy handed way.

The issue is that many WordPress themes have this in their CSS files:

.aligncenter {
margin: 0 auto;
}

That zeroes out the bottom margin on a centered button block.

If that style instead was:

.aligncenter {
margin-left: auto;
margin-right: auto;
}

... this would be a non issue.

So the question becomes — do we increase the specificity of the centered button block margin rules to cover up years of bad practice? Or are we okay with centered buttons having no bottom margin in many older WordPress themes?

Decide, then merge or don't ;)

This fixes #7812, though in a somewhat heavy handed way.

The issue is that many WordPress themes have this in their CSS files:

```
.aligncenter {
margin: 0 auto;
}
```

That zeroes out the bottom margin on a centered button block.

If that style instead was:

```
.aligncenter {
margin-left: auto;
margin-right: auto;
}
```

... this would be a non issue.

So the question becomes — do we increase the specificity of the centered button block margin rules to cover up years of bad practice? Or are we okay with centered buttons having no bottom margin in many older WordPress themes?

Decide, then merge or don't ;)
@jasmussen jasmussen added Needs Design Feedback Needs general design feedback. [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes. Needs Decision Needs a decision to be actionable or relevant labels Oct 10, 2018
@jasmussen jasmussen self-assigned this Oct 10, 2018
@jasmussen jasmussen requested a review from a team October 10, 2018 09:56
Copy link
Member

@tofumatt tofumatt left a comment

Choose a reason for hiding this comment

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

I would argue for moving forward and leaving those old themes behind. I don't think it's worth adding this fix for old themes that won't update, personally…

Having to manage this style for years to come in new themes seems just as annoying 🤷‍♂️

I'd say we should close the original bug as a won't fix.

@@ -28,6 +28,7 @@

.editor-block-list__block[data-type="core/image"][data-align="center"] {
.wp-block-image {
clear: both;
Copy link
Member

Choose a reason for hiding this comment

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

Is this needed only on editor?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, forgot to mention this in the change notes.

The issue I was seeing was floating a small image left, then centering a small image after that. This would stack up next to the small floated image in the editor, but not the front-end. I did not dig deeper, but I can.

@jasmussen
Copy link
Contributor Author

Closing based on feedback. We can always revisit if need be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Decision Needs a decision to be actionable or relevant Needs Design Feedback Needs general design feedback. [Type] Plugin Interoperability Incompatibilities between a specific plugin and the block editor. Close with workaround notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Button Block: button padding is different for left and center aligned buttons
3 participants