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

Theme.json: Add default values for settings.spacing.spacingScale #43860

Merged
merged 1 commit into from
Sep 6, 2022

Conversation

t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Sep 5, 2022

Follow-up on #41527

What?

This PR adds the default value for settings.spacing.spacingScale among the spacing size presets defined in thme.json.

Why?

Like many other presets, adding default values will help users set their own values, with auto-completion and validation.

How?

I have defined default values based on the default theme.json values in WordPress 6.1.

Testing Instructions

Create a JSON file that references the JSON schema for this branch, such as:

{
	"$schema": "https://raw.githubusercontent.com/WordPress/gutenberg/enhancement/theme-json-spacing-scale-default/schemas/json/theme.json",
	"version": 2,
	"settings": {
		"spacing": {
		}
	}
}

Under the settings.spacing.spacingScale property, confirm that default values are entered as initial values.
For the enum type, verify that the default value is indicated by the code editor.

Screenshots or screencast

4565e5708d5a9a07d7b9de275ab764c9.mp4

@t-hamano t-hamano added [Type] Developer Documentation Documentation for developers [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. labels Sep 5, 2022
@t-hamano t-hamano self-assigned this Sep 5, 2022
@t-hamano t-hamano force-pushed the enhancement/theme-json-spacing-scale-default branch 2 times, most recently from dc0cbe7 to 88f0c11 Compare September 5, 2022 13:55
@t-hamano t-hamano force-pushed the enhancement/theme-json-spacing-scale-default branch from 88f0c11 to d96277c Compare September 5, 2022 13:59
@t-hamano t-hamano marked this pull request as ready for review September 5, 2022 14:12
@t-hamano t-hamano changed the title [WIP] Theme.json: Add default values for settings.spacing.spacingScale Theme.json: Add default values for settings.spacing.spacingScale Sep 5, 2022
Copy link
Contributor

@glendaviesnz glendaviesnz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@t-hamano t-hamano merged commit ffd75bd into trunk Sep 6, 2022
@t-hamano t-hamano deleted the enhancement/theme-json-spacing-scale-default branch September 6, 2022 01:49
@github-actions github-actions bot added this to the Gutenberg 14.1 milestone Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Themes Questions or issues with incorporating or styling blocks in a theme. [Type] Developer Documentation Documentation for developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants