Repository navigation
Editor: Support the current state for Navigation Submenu in theme.json - #14284
MaggieCabrera wants to merge 1 commit into
Conversation
Adds `core/navigation-submenu` to `VALID_BLOCK_PSEUDO_SELECTORS` and `VALID_BLOCK_CUSTOM_STATES`, so themes can style the current link inside a submenu dropdown with `-current`, including its pseudo-selector states. Backports WordPress/gutenberg#76367. See #66312. 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. |
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. |
…on`. This changeset backports the `WP_Theme_JSON` changes from GB76367, and is a follow-up to #64806. Themes can style the current link inside a Navigation Submenu dropdown with `-current` on `core/navigation-submenu` in `theme.json`, including its `:hover`, `:focus`, `:focus-visible` and `:active states`. The block's `selectors.states` selector arrives with the Gutenberg package sync, so the new test uses `get_styles_for_block()` with explicit style nodes, like the existing custom state tests. Developed in: - #14284 - WordPress/gutenberg#76367 Follow-up to #62641. Props onemaggie. Fixes #66312. See #64806. git-svn-id: https://develop.svn.wordpress.org/trunk@64600 602fd350-edb4-49c9-b593-d223f7449a82
…on`. This changeset backports the `WP_Theme_JSON` changes from GB76367, and is a follow-up to #64806. Themes can style the current link inside a Navigation Submenu dropdown with `-current` on `core/navigation-submenu` in `theme.json`, including its `:hover`, `:focus`, `:focus-visible` and `:active states`. The block's `selectors.states` selector arrives with the Gutenberg package sync, so the new test uses `get_styles_for_block()` with explicit style nodes, like the existing custom state tests. Developed in: - WordPress/wordpress-develop#14284 - WordPress/gutenberg#76367 Follow-up to #62641. Props onemaggie. Fixes #66312. See #64806. Built from https://develop.svn.wordpress.org/trunk@64600 git-svn-id: http://core.svn.wordpress.org/trunk@63750 1a063a9b-81f0-0310-95a4-ce76da25c4cd
|
hey @audrasjb did you commit this to core? the GB PR didn't make it in. It had some feedback that I couldn't address in time for the release. I'm happy to try and bring it in for beta 2 though! |
Backports the
WP_Theme_JSONchanges from Gutenberg #76367, a follow-up to #11174 ([62641]).Themes can style the current link inside a Navigation Submenu dropdown with
-currentoncore/navigation-submenuin theme.json, including its:hover,:focus,:focus-visibleand:activestates.The block's
selectors.statesselector arrives with the Gutenberg package sync, so the new test usesget_styles_for_block()with explicit style nodes, like the existing custom state tests.Trac ticket: https://core.trac.wordpress.org/ticket/66312
Testing
vendor/bin/phpcs src/wp-includes/class-wp-theme-json.php tests/phpunit/tests/theme/wpThemeJson.phptest_block_custom_states_navigation_submenucovers-currentand-currentwith:hover. It fails without the constant changes.Use of AI Tools
AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Translating the Gutenberg changes to their WordPress Core counterparts, adding a test, 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.