From fe08c82a7ecbbffc87b2ca85c9965ea3209054e3 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Wed, 23 Sep 2026 15:15:26 +0100 Subject: [PATCH 1/3] Add pseudo-state controls for Navigation Link --- packages/global-styles-ui/CHANGELOG.md | 4 ++++ packages/global-styles-ui/src/test/utils.js | 12 +++++++++++- packages/global-styles-ui/src/utils.ts | 6 ++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/global-styles-ui/CHANGELOG.md b/packages/global-styles-ui/CHANGELOG.md index a94899dfe1ccbe..33091060757feb 100644 --- a/packages/global-styles-ui/CHANGELOG.md +++ b/packages/global-styles-ui/CHANGELOG.md @@ -2,6 +2,10 @@ ## Unreleased +### Bug Fixes + +- Blocks screen: restore the hover, focus, focus-visible and active state controls for the Navigation Link block, which the block already declared support for in PHP and in the style engine. + ## 1.23.0 (2026-09-23) ### Enhancements diff --git a/packages/global-styles-ui/src/test/utils.js b/packages/global-styles-ui/src/test/utils.js index be9b7383921edc..616196648c619c 100644 --- a/packages/global-styles-ui/src/test/utils.js +++ b/packages/global-styles-ui/src/test/utils.js @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest'; -import { getNewIndexFromPresets } from '../utils'; +import { getNewIndexFromPresets, getValidPseudoStates } from '../utils'; const validPresets = { single: [ { slug: 'preset-1' } ], @@ -55,3 +55,13 @@ describe( 'getNewIndexFromPresets', () => { } ); } ); } ); + +describe( 'getValidPseudoStates', () => { + it( 'offers hover, focus, focus-visible and active for the Navigation Link block', () => { + expect( + getValidPseudoStates( 'core/navigation-link' ).map( + ( state ) => state.value + ) + ).toEqual( [ ':hover', ':focus', ':focus-visible', ':active' ] ); + } ); +} ); diff --git a/packages/global-styles-ui/src/utils.ts b/packages/global-styles-ui/src/utils.ts index a1f3e1c04241e7..75605e800f691a 100644 --- a/packages/global-styles-ui/src/utils.ts +++ b/packages/global-styles-ui/src/utils.ts @@ -55,6 +55,12 @@ export const VALID_BLOCK_STATES: Record< string, StateDefinition[] > = { { value: ':focus-visible', label: __( 'Focus-visible' ) }, { value: ':active', label: __( 'Active' ) }, ], + 'core/navigation-link': [ + { value: ':hover', label: __( 'Hover' ) }, + { value: ':focus', label: __( 'Focus' ) }, + { value: ':focus-visible', label: __( 'Focus-visible' ) }, + { value: ':active', label: __( 'Active' ) }, + ], }; /** From afb6cf82da7c6d6b72812a6a22d6bdd4a12748b2 Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Wed, 23 Sep 2026 15:38:56 +0100 Subject: [PATCH 2/3] Tweak changelog entry --- packages/global-styles-ui/CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/global-styles-ui/CHANGELOG.md b/packages/global-styles-ui/CHANGELOG.md index 33091060757feb..82c63472c0f84e 100644 --- a/packages/global-styles-ui/CHANGELOG.md +++ b/packages/global-styles-ui/CHANGELOG.md @@ -2,9 +2,9 @@ ## Unreleased -### Bug Fixes +### Enhancements -- Blocks screen: restore the hover, focus, focus-visible and active state controls for the Navigation Link block, which the block already declared support for in PHP and in the style engine. +- Blocks screen: add the hover, focus, focus-visible and active state controls for the Navigation Link block, which already supports those states in `theme.json` and in the block inspector. ## 1.23.0 (2026-09-23) From 48d13cc7e3e56436cb22bda5b4986b4030ea604b Mon Sep 17 00:00:00 2001 From: Sarah Norris Date: Wed, 23 Sep 2026 15:42:59 +0100 Subject: [PATCH 3/3] Add PR number to changelog --- packages/global-styles-ui/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/global-styles-ui/CHANGELOG.md b/packages/global-styles-ui/CHANGELOG.md index 82c63472c0f84e..67aba64fc59043 100644 --- a/packages/global-styles-ui/CHANGELOG.md +++ b/packages/global-styles-ui/CHANGELOG.md @@ -4,7 +4,7 @@ ### Enhancements -- Blocks screen: add the hover, focus, focus-visible and active state controls for the Navigation Link block, which already supports those states in `theme.json` and in the block inspector. +- Blocks screen: add the hover, focus, focus-visible and active state controls for the Navigation Link block, which already supports those states in `theme.json` and in the block inspector ([#83451](https://github.com/WordPress/gutenberg/pull/83451)). ## 1.23.0 (2026-09-23)