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

Allow creation of a limited list of spacing options for spacing.units #34210

Closed
eric-michel opened this issue Aug 20, 2021 · 0 comments
Closed
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

@eric-michel
Copy link

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:
image-(2)

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.

@ramonjd ramonjd added [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. labels Aug 24, 2021
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

2 participants