-
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
Editor text has no default left/right margin unless theme opts into site-wide padding #35884
Comments
I think this is a side effect of the removal of the |
To start with, we should definitely add it by default for non-block themes. That'll fix the regression aspect. For block themes, I wonder if it makes sense to add a default padding value back in — when we removed it, there was no site padding control, but now it's a bit easier to specify that. And I think explorations like #35919 will make the control even more useful. @jasmussen do you have any ideas? |
Could we add those 8px by default to lib/theme.json? If the "outer padding" aspect gets addressed, then it seems like it might thread the needle between a good default, theme control, and flexibility? Or am I missing a piece? |
Yeah, that's more or less what I'm thinking at this point too. |
@noisysocks I think we should add this to 5.9 must-haves, since it effects a large quantity of themes. |
I was testing and checking emptytheme and on trunk, with no padding defined, emptytheme doesn't have padding at all on frontend or backend, I think that's the correct behavior. I talked about this with @kjellr and it seems like this is more of a problem for classic themes not using theme.json. Would the solution be to add this padding in the editor only for classic themes? And let block themes handle this padding or lack thereof via theme.json and ideally #35919 or a similar solution? |
@MaggieCabrera Are you saying add the padding only if theme.json is not present in a classic theme? |
Yeah, and only in the editor, not the frontend, so that it behaves like before the regression, but excluding themes with a theme.json file. |
@MaggieCabrera that makes sense to me, I agree with that solution. |
I think that makes sense for now as a fix the regression in older themes. |
It looks like we don't have a solution for this issue yet. I'm going to remove the issue from the 5.9 board. We can try and fix this in the next release. |
Reopening as this was never resolved. |
Adding https://github.com/Automattic/themes/blob/trunk/archeo/style.css as an example of how themes have worked around current issues props @scruffian |
Just in case it helps for whoever picks up this issue, we currently output styles for the root block selector at this line in the theme JSON class: https://github.com/wordpress/gutenberg/blob/trunk/lib/compat/wordpress-6.0/class-wp-theme-json-gutenberg.php#L106, so that ( |
I'm not sure what the intended goal for this issue currently is. The classic theme regression has been fixed, which this comment and following imply is the major concern here. It would be good to at least be clear about the scope of the problem we're trying to fix: do we want a default padding added for block themes just in the post editor? Or can this be addressed globally as part of #35607? |
I think this could be addressed globally as part of #35607, if that issue implemented a default that wasn't |
I think can close this as it's part of #35607 |
If a theme does not opt into site-wide padding through theme.json, and the user does not specify site padding through Global Styles, the post/page editor currently provides no left/right margins to prevent text from bumping up against the edges of the screen:
This is sort of an issue for block themes, since it effectively requires them to supply either a site-wide padding value, or some custom CSS. More importantly though, it's a regression in the editor experience for users of classic themes that don't manually provide these margins.
To reproduce:
Gutenberg version: Version 11.8.0-rc.2
Related: WordPress/twentytwentytwo#144
cc @youknowriad since this may be related to removing the site-wide margin.
The text was updated successfully, but these errors were encountered: