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

Add missing pseudo-selectors to theme.json schema and documentation #49202

Merged
merged 2 commits into from Mar 20, 2023

Conversation

t-hamano
Copy link
Contributor

@t-hamano t-hamano commented Mar 20, 2023

Related core ticket: Changeset 55121 – WordPress Trac
Related issue: #49013

What?

This PR adds the missing pseudo-selectors to the JSON schema and developer documentation.

json-schema

Testing Instructions

Create a JSON file that references this PR with the $schema property:

{
	"$schema": "https://raw.githubusercontent.com/WordPress/gutenberg/fix/schema-for-pseudo-classes/schemas/json/theme.json",
	"version": 2,
	"styles": {
		"elements": {
			"link": {
			},
			"button": {
			}
		},
		"blocks": {
			"core/button": {
				"elements": {
					"button": {
					},
					"link": {
					}
				}
			}
		}
	}
}

Confirm that a total of six pseudo-classes appear as property candidates directly under elements.link and elements.button.

@t-hamano t-hamano added [Feature] Themes Questions or issues with incorporating or styling blocks in a theme. Developer Experience Ideas about improving block and theme developer experience labels Mar 20, 2023
@t-hamano t-hamano changed the title Theme JSON schema: Add missing pseudo properties to link Add missing pseudo-selectors to theme.json schema and documentation Mar 20, 2023
@t-hamano t-hamano added the [Type] Developer Documentation Documentation for developers label Mar 20, 2023
@t-hamano t-hamano force-pushed the fix/schema-for-pseudo-classes branch from 41387b7 to dd490cb Compare March 20, 2023 12:24
@t-hamano t-hamano marked this pull request as ready for review March 20, 2023 12:25
@t-hamano
Copy link
Contributor Author

I have found that a similar schema fix was backported to wp/6.2 branch in #48948. I don't know if it is possible to backport it now, but I will give it a backport label just in case.

@t-hamano t-hamano added the Backport to WP Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Mar 20, 2023
@t-hamano t-hamano self-assigned this Mar 20, 2023
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.

Looks good to me 👍

I see :link and :any-link in the list of VALID_ELEMENT_PSEUDO_SELECTORS.

@ajlende ajlende merged commit f1f2e31 into trunk Mar 20, 2023
45 checks passed
@ajlende ajlende deleted the fix/schema-for-pseudo-classes branch March 20, 2023 20:23
@github-actions github-actions bot added this to the Gutenberg 15.5 milestone Mar 20, 2023
@Mamaduka
Copy link
Member

I just cherry-picked this PR to the wp/6.2 branch to get it included in the next release: 6f05e23

@Mamaduka Mamaduka removed the Backport to WP Beta/RC Pull request that needs to be backported to the WordPress major release that's currently in beta label Mar 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Developer Experience Ideas about improving block and theme developer experience [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.

None yet

3 participants