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 schema: add heading/button key to color definition #55674

Merged
merged 4 commits into from
Nov 22, 2023

Conversation

t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Oct 28, 2023

Follow-up on #49131
Similar to #55675

What?

This PR adds heading/button key to color definition in theme.json schema.

Why?

To allow developers to design theme.json with reference to the correct schema.

Testing Instructions

Create the following JSON file locally, specifying the JSON schema changed by this PR.

{
	"$schema": "https://raw.githubusercontent.com/WordPress/gutenberg/schema/theme-button-heading/schemas/json/theme.json",
	"version": 2
}
  • You should see the button and heading keys listed in the settings.color property.
  • You should see the button and heading keys listed in the settings.block.{blockName}.color property.
  • The default value of true should be set when the button or heading key is selected.

capture

@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 Oct 28, 2023
@t-hamano t-hamano self-assigned this Oct 28, 2023
@t-hamano t-hamano marked this pull request as ready for review October 28, 2023 02:57
@@ -231,6 +231,16 @@
"description": "Allow users to set text colors.",
"type": "boolean",
"default": true
},
"heading": {
"description": "Allow users to set heading colors.",
Copy link
Contributor

Choose a reason for hiding this comment

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

I find this confusing because it can easily be mixed up with styles > elements > headings.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Indeed. What about "Allow users to set heading colors in a block."?

Copy link
Contributor

@ajlende ajlende left a comment

Choose a reason for hiding this comment

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

I'm fine with either phrasing for the description. If we do add "in a block" to the heading description, we should also update the description for button, link, and text too.

@t-hamano
Copy link
Contributor Author

If we do add "in a block" to the heading description, we should also update the description for button, link, and text too.

Makes sense. The theme.json schema's settings.color.{text|link|heading|button} all have the phrase "in a block". I would like to add similar phrases to these properties in block.json and then merge this PR.

block_json_description

@t-hamano t-hamano merged commit fbc962c into trunk Nov 22, 2023
49 checks passed
@t-hamano t-hamano deleted the schema/theme-button-heading branch November 22, 2023 14:20
@github-actions github-actions bot added this to the Gutenberg 17.2 milestone Nov 22, 2023
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.

3 participants