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

Buttons: Support gap via theme.json #34527

Closed
jasmussen opened this issue Sep 3, 2021 · 3 comments · Fixed by #34546
Closed

Buttons: Support gap via theme.json #34527

jasmussen opened this issue Sep 3, 2021 · 3 comments · Fixed by #34546
Labels
[Block] Buttons Affects the Buttons Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json

Comments

@jasmussen
Copy link
Contributor

What problem does this address?

#32366 adds a theme.json mechanism to provide a a blockGap value to space out items in a container. Spacing using gap has the benefit of letting you not worry about the first or last elements in a container, or complex nth-child margins in containers that wrap.

What is your proposed solution?

As a next step, it would be nice to connect the block with theme.json, so that the block becomes a flex container with a custom gap value, such as this:

"core/buttons": {
	"spacing": {
		"blockGap": "2em"
	}
}

#33991 also provided a UI for the gap control, which would benefit here as well.

@jasmussen jasmussen added [Block] Buttons Affects the Buttons Block Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi labels Sep 3, 2021
@andrewserong andrewserong linked a pull request Sep 5, 2021 that will close this issue
7 tasks
@andrewserong
Copy link
Contributor

There's a PR in progress that will address this — #34546 (thanks for picking that up, @stacimc!)

@bradhogan
Copy link

This appears to be added now, but it's not working. Whatever blockGap I define in my theme.json is ignored.

@andrewserong
Copy link
Contributor

@bradley2083 there's a bit more context in #39789, which is the current issue for tracking adding back in support for blockGap at the block level within theme.json. (There is a WIP PR to add the support in #39870)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Buttons Affects the Buttons Block [Feature] Design Tools Tools that impact the appearance of blocks both to expand the number of tools and improve the experi Global Styles Anything related to the broader Global Styles efforts, including Styles Engine and theme.json
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants