-
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
Convert all px
values in front-facing styles to relative (em
) units
#24523
Convert all px
values in front-facing styles to relative (em
) units
#24523
Conversation
…ry-relative-units
…try-relative-units
…try-relative-units
Tested this and it's definitely due to the theme's styles... .has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-excerpt,
.has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-meta {
margin-left: 5.5rem;
} The block styles on their own look like this: The problem in the twentytwenty theme is the fact that it's basically using the rem-hack mentioned in a previous comment, and tweaking the margin of excerpts & meta but not the body of the comment 🤷 |
Fixed the off-center thing in |
The Social Icons block is certainly an interesting case. I'm not really sure whether it should scale with the font size or not. I think it would be fine to leave it out of this PR; we can always change it later. |
I agree 100% with the above assessments regarding social-icons. |
It's already a sweet PR, and nothing blocks us from a separate social icons PR ✨ Thank you. |
What is blocking us for this one? |
Just a final test/sanity check. I'm happy to take a look tomorrow and 👍 👍 this one, in the mean time if others on the thread feel confident they can approve it. At a quick glance, all looks good to me. |
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.
I've looked through every file, and it seems good enough to merge at this point. We can always polish things more in future PRs.
I'm going to go ahead and merge this now. |
Mmm, how much testing and thought has been put into how this change might cause visual difference on people's sites depending on what themes are choosing to overwrite or the contexts in which they do so? If themes have different containers where they are already relying on ems the cascade might cause unexpected visual results. My inclination would be to not do a change like this until it can be properly structured through the |
As far as I can tell, these changes would be more likely to make things work better with themes. Previously, the values were mostly hardcoded It seems to me that using Still, I've added a "Needs Dev Note" label, as this is something we should let people know about either way. |
It doesn't matter if it's a better default if it can still cause regressions for people's sites that they may not know how to solve or address themselves. For better or worse, themes and users would have accommodated how block styles interact with themes so far (not to mention all the third-party blocks that might also be using pixels). I think this is something we should do more carefully, ideally pairing it with a default unit spec (connected to the unit control component as well for custom styles, which right now is gated on an |
@@ -92,7 +92,7 @@ | |||
} | |||
|
|||
.wp-block-cover__inner-container { | |||
width: calc(100% - 70px); | |||
width: calc(100% - 4.375em); |
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.
I think this one is maybe something to revert. I don't 100% fully understand where those 70px come from (cc: @jorgefilipecosta perhaps?) but I think given it's part of a calc
statement, it was potentially important that this remained a pixel value.
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.
I reviewed the PR you submitted it seems we can just remove the rule 👍
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.
@jasmussen @jorgefilipecosta Please see comment here:
#25103 (comment)
This is causing styling breakages on the frontend for cover blocks.
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.
Thanks again @johnstonphilip. I believe that #26143 to fix it.
This is the result of many smaller PRs combined.
Came up in a discussion in #24409 (comment) that it might be preferable to have all smaller PRs combined in a single one.
This one contains commits from #24433, #24432, #24404, #24413, #24407, #24405, #24322, #24323, #24330 #24409, as well as a few additional commits that take care of any remaining absolute units conversions.