Repository navigation
Editor: Add pseudo-selector support for text inputs (backport GB #71634) - #13056
MaggieCabrera wants to merge 5 commits into
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
Backports the select element changes from Gutenberg PR #81644. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…tors. Syncs the text input changes with Gutenberg PR #71634. `:valid` and `:invalid` are replaced by `:user-valid` and `:user-invalid`, which only match after a visitor interacts with the field. Pseudo-element rules such as `::placeholder` are now output as `:root :where(base)::placeholder`, so they get the same specificity at the element, block and block style variation levels. Adds tests for the text input states, their cascade order, block-level and variation `::placeholder` styles, and sanitization. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ate. Splits the 7.2.0 `@since` entry so it lists the states added for the select and text input elements, and extends the select tests to cover `:focus`, `:active` and a block-level select in the Categories block. Follow-up to review feedback on WordPress/gutenberg#81644. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Is this still a draft? |
Keeps the text input and select changes in separate commits so either can be reverted on its own. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
I see that WordPress/gutenberg#71634 was also merged. Seems we want to land this in 7.2. @audrasjb, do you have bandwidth to do a technical review? |
mikachan
left a comment
There was a problem hiding this comment.
This reads well to me and the logic is the same as WordPress/gutenberg#71634. I think it's ready to bring in since WordPress/gutenberg#71634 has merged.
|
I've backported the Gutenberg merge to the |
hi, yes, please, and thank you all for your time in this busy day. This and #14544 I would like to bring both in for 7.2. For that one I'm waiting on the GB tests to pass, it's already approved and set to auto merge. Your call if you feel like it's too late to put them in. |
|
I can commit this to trunk, working on it now. Thanks @Mamaduka! |
Adds `:required`, `:user-valid`, `:user-invalid`, `:focus`, `:focus-visible`, and `::placeholder` to the pseudo selectors that `WP_Theme_JSON` allows for the `textInput` element, so themes can style these states in `theme.json`. Developed in #13056. Discussed in WordPress/gutenberg#71634. Props onemaggie, scruffian, sarthaknagoshe2002, wildworks, im3dabasia1, audrasjb, mamaduka. Fixes #65880. git-svn-id: https://develop.svn.wordpress.org/trunk@64597 602fd350-edb4-49c9-b593-d223f7449a82
Adds `:required`, `:user-valid`, `:user-invalid`, `:focus`, `:focus-visible`, and `::placeholder` to the pseudo selectors that `WP_Theme_JSON` allows for the `textInput` element, so themes can style these states in `theme.json`. Developed in WordPress/wordpress-develop#13056. Discussed in WordPress/gutenberg#71634. Props onemaggie, scruffian, sarthaknagoshe2002, wildworks, im3dabasia1, audrasjb, mamaduka. Fixes #65880. Built from https://develop.svn.wordpress.org/trunk@64597 git-svn-id: http://core.svn.wordpress.org/trunk@63747 1a063a9b-81f0-0310-95a4-ce76da25c4cd
Backports the
WP_Theme_JSONchanges from Gutenberg PR #71634.This adds
:required,:user-valid,:user-invalid,:focus,:focus-visible, and::placeholdersupport for thetextInputelement. Pseudo-elements are output without the:where()wrapper because pseudo-elements are not valid inside it.Trac ticket: https://core.trac.wordpress.org/ticket/65880
Testing
php -l src/wp-includes/class-wp-theme-json.php tests/phpunit/tests/theme/wpThemeJson.phpvendor/bin/phpcs src/wp-includes/class-wp-theme-json.php tests/phpunit/tests/theme/wpThemeJson.phptext_inputtests inwpThemeJson.phpcover the text input states.Use of AI Tools
AI assistance: Yes
Tool(s): OpenAI Codex, Claude Code
Model(s): GPT-5, Claude Opus 5.5
Used for: Translating the Gutenberg changes to their WordPress Core counterparts, adding tests, running validation, and drafting the pull request.
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.