-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Description
What problem does this address?
Getting custom padding, margin, and border controls in Gutenberg is great! But allowing any amount of spacing may be too flexible for some users.
What is your proposed solution?
Similar to the way font size options can be limited to a dropdown of options, having spacing.units in theme.json support an array of values would allow us to create a curated list of spacing options for our less tech-savvy users.
For instance, it would be great if theme.json supported something like this:
"spacing": {
"units": [
{
"slug": "xs",
"size": "0.25rem",
"name": "XS"
},
{
"slug": "sm",
"size": "0.5rem",
"name": "SM"
},
{
"slug": "md",
"size": "1rem",
"name": "MD"
},
{
"slug": "lg",
"size": "2rem",
"name": "LG"
},
{
"slug": "xl",
"size": "4rem",
"name": "XL"
},
]
},
Then, when adding custom padding to a block, these spaces would be dropdowns instead of normal inputs:

This would make things easier for our content specialists and clients who manage their own content, and want to have some more control over design without the confusion of various units and what they mean.