Skip to content
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

Advanced Margin and Padding Editing for Block #69358

Open
orionp13 opened this issue Feb 27, 2025 · 8 comments
Open

Advanced Margin and Padding Editing for Block #69358

orionp13 opened this issue Feb 27, 2025 · 8 comments
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Type] Enhancement A suggestion for improvement.

Comments

@orionp13
Copy link

Currently, the management of internal (padding) and external (margin) spacing for blocks in Gutenberg is limited and not very intuitive. Adding an advanced interface similar to Elementor would allow users to have precise control over block spacing without needing custom CSS.

Ideally, each block should have a dedicated section in its settings to manage individual margins and padding for each side (top, bottom, left, right). A linking option to apply the same margin or padding to all sides, along with configurable units (px, %, em, rem, etc.), would significantly enhance the user experience.

Real-time preview of spacing adjustments would save time and eliminate the need for blind testing. This improvement would give users better control over their layouts while making Gutenberg more competitive with visual page builders.

Image

@orionp13 orionp13 added the [Type] Enhancement A suggestion for improvement. label Feb 27, 2025
@hanneslsm
Copy link

Not sure if I get it but everything is already possible.
You can individually set the padding and margin for top, right, bottom and left (click on the chain icon) and you can also define different units in the theme.json even not so common ones like dvh or dvw.

Image

@orionp13
Copy link
Author

can we do this in EVERY BLOCK ?

@hanneslsm
Copy link

yes, for most. here is an overview: #43243

@t-hamano
Copy link
Contributor

t-hamano commented Mar 3, 2025

Can we close this issue as a duplicate of #43243? Is there something missing in the current margin/padding UI itself?

@t-hamano t-hamano added the [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi label Mar 3, 2025
@kyle-charlton
Copy link

Could we get the ability to use clamp in the advanced options?
Clamp would give developers way more control over responsive spacing which would help eliminate the need to override spacing with media queries in the custom CSS.

@t-hamano
Copy link
Contributor

t-hamano commented Mar 5, 2025

Clamp would give developers way more control over responsive spacing which would help eliminate the need to override spacing with media queries in the custom CSS.

I think this is certainly useful, so we might leave this issue open.

FWIW, I also think the suggestions regarding responsive design are worth noting.

@hanneslsm
Copy link

Could we get the ability to use clamp in the advanced options?
Clamp would give developers way more control over responsive spacing which would help eliminate the need to override spacing with media queries in the custom CSS.

I am using clamp in my spacing variables in the theme.json already. So it does work already, it's only that the interface doesn't support it yet.

@coder-rancho
Copy link

I am using clamp in my spacing variables in the theme.json already. So it does work already, it's only that the interface doesn't support it yet.

Yes, we can define spacing variables but clamp() would give the ability to set responsive spacing for individual block.

I was looking into the codebase. I find out that in order to implement this feature we need to modify style-engine codebase along with BoxControl component. The codebase seems highly cohesive and we need to loop in someone who has worked on these components.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi [Type] Enhancement A suggestion for improvement.
Projects
None yet
Development

No branches or pull requests

5 participants