-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Button Block: fix space insertion #14925
Conversation
I don't want to block this fix if it makes the Button block unusable in Firefox. But this PR as it is, will cause #10565 to regress back again, so if there is at all time, I would like us to first understand how the whitespace rules breaks things in Firefox even though it should be scoped to just the preview ( |
These seem to be the built styles: .wp-block-button__link {
background-color: #32373c;
border: none;
border-radius: 28px;
box-shadow: none;
color: inherit;
cursor: pointer;
display: inline-block;
font-size: 18px;
margin: 0;
padding: 12px 24px;
text-align: center;
text-decoration: none;
white-space: normal;
overflow-wrap: break-word; } |
@jasmussen Made a mistake. It wasn't your commit that broke it, it seems to be a way older issue! :) |
In my testing, I still see the original issue meant to be addressed by #10565, but ... I also see it in master, so it doesn't seem like something which regressed here. |
@@ -15,7 +15,7 @@ | |||
// breaking spaces in between words. If also prevent Firefox from inserting | |||
// a trailing `br` node to visualise any trailing space, causing the element | |||
// to be saved. | |||
white-space: pre-wrap; | |||
white-space: pre-wrap !important; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Safe to say this is !important
because it breaks spectacularly when any other style takes precedence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I would say that this is the only CSS rule required for RichText to work properly. It might even be better to insert it inline? Not sure.
@@ -27,7 +27,6 @@ $blocks-button__height: 56px; | |||
padding: 12px 24px; | |||
text-align: center; | |||
text-decoration: none; | |||
white-space: normal; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!
b429804
to
88b35b6
Compare
As noted in #14925 (comment), this will regress #10565. Which is not the end of the world, but also worth noting. |
@jasmussen How is that possible? I'm not touching the styles in |
Ah, in the small previews, they're all |
The !important would override the preview aspects. I can't answer why the |
@jasmussen I fixed it but ideally, it should be revised. :) |
Thank you! 💕 |
* Button Block: fix space insertion * Typo * Allow rule for preview
* Button Block: fix space insertion * Typo * Allow rule for preview
* Button Block: fix space insertion * Typo * Allow rule for preview
Description
Fixes #14914.
How has this been tested?
Screenshots
Types of changes
Checklist: