-
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
Global Styles: Margins on the paragraph block #35267
Comments
The title of the ticket is a bit too simplistic, this issue actually nullifies any margin settings set in theme.json if |
I noticed this effect when trying to layout a homepage in the Site Editor using stacked Group Blocks. This is the effect I was after (the mixed units are just there so I can recognize my styles in the inspector 😄 ): "blocks": {
"core/group": {
"spacing": {
"margin": {
"top": "0rem",
"bottom": "0px"
}
}
}, When blockGap is enabled: The only way I found to get around it is to opt-in to Here is where we're adding the specific CSS for the default layout support. The The extra specificity is explained in the layout rule builder utility comments: // Ideally we shouldn't need the `.editor-styles-wrapper` increased specificity here
// The problem though is that we have a `.editor-styles-wrapper p { margin: reset; }` style
// it's used to reset the default margin added by wp-admin to paragraphs
// so we need this to be higher speficity otherwise, it won't be applied to paragraphs inside containers
// When the post editor is fully iframed, this extra classname could be removed. The Post Editor doesn't yet appear to be "fully iframed" I agree that styles defined at the block level in theme.json should override the rules of the layout abstraction. What's the right approach? Make these styles even more specific?
Nope, just tried it 😄 |
Closing since #47858 has been merged. |
Description
When a theme is opted in to blockGap, its not possible to set margins on the paragraph block.
Step-by-step reproduction instructions
Screenshots, screen recording, code snippet
Environment info
No response
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: