From ef1fb4d939af164049461789e5882a4708ee41e6 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Fri, 29 May 2026 09:01:44 +0900 Subject: [PATCH 01/16] Fix UI Button loading state in forced colors --- packages/ui/src/button/button.tsx | 2 +- packages/ui/src/button/style.module.css | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/ui/src/button/button.tsx b/packages/ui/src/button/button.tsx index 9962c5b9d56502..def94dd12f2cab 100644 --- a/packages/ui/src/button/button.tsx +++ b/packages/ui/src/button/button.tsx @@ -55,7 +55,7 @@ export const Button = forwardRef< HTMLButtonElement, ButtonProps >( disabled={ disabled ?? loading } { ...props } > - { children } + { children } ); } diff --git a/packages/ui/src/button/style.module.css b/packages/ui/src/button/style.module.css index c098782a123ad8..3be4125c371f66 100644 --- a/packages/ui/src/button/style.module.css +++ b/packages/ui/src/button/style.module.css @@ -136,6 +136,15 @@ } } + .content { + display: inline-flex; + justify-content: center; + align-items: center; + gap: inherit; + max-width: 100%; + min-width: 0; + } + .is-small { --wp-ui-button-padding-block: 0; --wp-ui-button-padding-inline: var(--wpds-dimension-padding-sm); @@ -227,7 +236,7 @@ color: transparent; } - * { + .content { opacity: 0; } From da9e3bd75842b17dc30aa0dbb4a5ff4d1a2436d7 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Sat, 30 May 2026 01:02:14 +0900 Subject: [PATCH 02/16] Simplify --- packages/ui/src/button/style.module.css | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/ui/src/button/style.module.css b/packages/ui/src/button/style.module.css index 3be4125c371f66..b16b40645061cc 100644 --- a/packages/ui/src/button/style.module.css +++ b/packages/ui/src/button/style.module.css @@ -36,9 +36,6 @@ /* Styles */ position: relative; display: inline-flex; - justify-content: center; - align-items: center; - gap: var(--wpds-dimension-gap-sm); aspect-ratio: var(--wp-ui-button-aspect-ratio); min-width: var(--wp-ui-button-min-width); max-width: 100%; @@ -138,9 +135,10 @@ .content { display: inline-flex; + flex: 1 1 auto; justify-content: center; align-items: center; - gap: inherit; + gap: var(--wpds-dimension-gap-sm); max-width: 100%; min-width: 0; } From f6168844e1e5993dbfeeac483e2a258f9c9e61f4 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Sat, 30 May 2026 01:04:12 +0900 Subject: [PATCH 03/16] Remove unnecessary color styles --- packages/ui/src/button/style.module.css | 8 -------- 1 file changed, 8 deletions(-) diff --git a/packages/ui/src/button/style.module.css b/packages/ui/src/button/style.module.css index b16b40645061cc..7df7709ea59cf3 100644 --- a/packages/ui/src/button/style.module.css +++ b/packages/ui/src/button/style.module.css @@ -226,14 +226,6 @@ } .is-loading { - color: transparent; - - /* Keep text transparent when a loading button is hovered — needed because - the hover state now sets `color` as a property declaration. */ - &:not([data-disabled]):is(:hover, :active, :focus) { - color: transparent; - } - .content { opacity: 0; } From 59777ed858a1c3325004915a3b9970b02a976a74 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Sat, 30 May 2026 01:07:04 +0900 Subject: [PATCH 04/16] Simplify --- packages/ui/src/button/style.module.css | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/ui/src/button/style.module.css b/packages/ui/src/button/style.module.css index 7df7709ea59cf3..416ce4d6b56e20 100644 --- a/packages/ui/src/button/style.module.css +++ b/packages/ui/src/button/style.module.css @@ -64,7 +64,7 @@ @media not ( prefers-reduced-motion ) { transition: color 0.1s ease-out; - * { + .content { transition: opacity 0.1s ease-out; } } @@ -139,7 +139,6 @@ justify-content: center; align-items: center; gap: var(--wpds-dimension-gap-sm); - max-width: 100%; min-width: 0; } From 868f2e896d684f77261d48e351c6f9a4c355ccf4 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Sat, 30 May 2026 01:50:08 +0900 Subject: [PATCH 05/16] Fix spinner in forced-colors mode --- packages/ui/src/button/style.module.css | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/packages/ui/src/button/style.module.css b/packages/ui/src/button/style.module.css index 416ce4d6b56e20..95cf8635724c9a 100644 --- a/packages/ui/src/button/style.module.css +++ b/packages/ui/src/button/style.module.css @@ -130,6 +130,12 @@ @media not ( prefers-reduced-motion ) { transition: opacity 0.1s ease-out; } + + @media ( forced-colors: active ) { + border-color: currentColor; + border-block-end-style: none; + border-inline-start-style: none; + } } } From 294345a1aa884b43c2f69759e1a5ac74733bc496 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Sat, 30 May 2026 02:03:01 +0900 Subject: [PATCH 06/16] Don't add content styles when unstyled --- packages/ui/src/button/style.module.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ui/src/button/style.module.css b/packages/ui/src/button/style.module.css index 95cf8635724c9a..ab4e224da81e7c 100644 --- a/packages/ui/src/button/style.module.css +++ b/packages/ui/src/button/style.module.css @@ -64,7 +64,7 @@ @media not ( prefers-reduced-motion ) { transition: color 0.1s ease-out; - .content { + &:not(.is-unstyled) .content { transition: opacity 0.1s ease-out; } } @@ -139,7 +139,7 @@ } } - .content { + .button:not(.is-unstyled) .content { display: inline-flex; flex: 1 1 auto; justify-content: center; @@ -231,7 +231,7 @@ } .is-loading { - .content { + &:not(.is-unstyled) .content { opacity: 0; } From 8560f75101e7b500148edf749a41bfdbd4636acf Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Sat, 30 May 2026 02:26:38 +0900 Subject: [PATCH 07/16] Keep unstyled Button loading content hidden --- packages/ui/src/button/style.module.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/src/button/style.module.css b/packages/ui/src/button/style.module.css index ab4e224da81e7c..42a8cd43ce5d63 100644 --- a/packages/ui/src/button/style.module.css +++ b/packages/ui/src/button/style.module.css @@ -231,7 +231,7 @@ } .is-loading { - &:not(.is-unstyled) .content { + .content { opacity: 0; } From 55eb4bacac503b3283272cc2b6116baf0cf663f4 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Sat, 30 May 2026 02:26:39 +0900 Subject: [PATCH 08/16] Add changelog --- packages/ui/CHANGELOG.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index 1d5d1651c8afcd..3ccf9c266bdbb5 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -2,10 +2,18 @@ ## Unreleased +### Breaking Changes + +- `Button`: Button children are now wrapped in an inner ``. Custom CSS or event handling that relies on direct-child selectors, such as `.my-button > svg`, or on `event.target` pointing to a child element may need updating. The wrapper layout styles only apply to styled variants; `variant="unstyled"` receives the wrapper DOM without the styled wrapper layout ([#78820](https://github.com/WordPress/gutenberg/pull/78820)). + ### Enhancements - `Tooltip.Provider`: Widen the types to accept all props of the equivalent `Tooltip.Provider` from `@base-ui/react` (types-only change) ([#78642](https://github.com/WordPress/gutenberg/pull/78642)). +### Bug Fixes + +- `Button`: Hide loading content and keep the loading spinner visually animated in forced colors mode ([#78820](https://github.com/WordPress/gutenberg/pull/78820)). + ## 0.14.0 (2026-05-27) ### Breaking Changes From 927a682ccc5422f581519909d65243454dab6f39 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Sat, 30 May 2026 02:40:13 +0900 Subject: [PATCH 09/16] Restore unstyled Button loading behavior --- packages/ui/CHANGELOG.md | 4 ++-- packages/ui/src/button/style.module.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index 3ccf9c266bdbb5..699d4c95c6769d 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -4,7 +4,7 @@ ### Breaking Changes -- `Button`: Button children are now wrapped in an inner ``. Custom CSS or event handling that relies on direct-child selectors, such as `.my-button > svg`, or on `event.target` pointing to a child element may need updating. The wrapper layout styles only apply to styled variants; `variant="unstyled"` receives the wrapper DOM without the styled wrapper layout ([#78820](https://github.com/WordPress/gutenberg/pull/78820)). +- `Button`: Button children are now wrapped in an inner ``. Custom CSS or event handling that relies on direct-child selectors, such as `.my-button > svg`, or on `event.target` pointing to a child element may need updating. The wrapper layout and loading-content hiding styles only apply to styled variants; `variant="unstyled"` receives the wrapper DOM without the styled wrapper layout, and its loading content is no longer hidden by `@wordpress/ui` styles ([#78820](https://github.com/WordPress/gutenberg/pull/78820)). ### Enhancements @@ -12,7 +12,7 @@ ### Bug Fixes -- `Button`: Hide loading content and keep the loading spinner visually animated in forced colors mode ([#78820](https://github.com/WordPress/gutenberg/pull/78820)). +- `Button`: Hide loading content for styled variants and keep the loading spinner visually animated in forced colors mode ([#78820](https://github.com/WordPress/gutenberg/pull/78820)). ## 0.14.0 (2026-05-27) diff --git a/packages/ui/src/button/style.module.css b/packages/ui/src/button/style.module.css index 42a8cd43ce5d63..ab4e224da81e7c 100644 --- a/packages/ui/src/button/style.module.css +++ b/packages/ui/src/button/style.module.css @@ -231,7 +231,7 @@ } .is-loading { - .content { + &:not(.is-unstyled) .content { opacity: 0; } From b6db6da524500332da93943947825350e9a72563 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Sat, 30 May 2026 02:41:58 +0900 Subject: [PATCH 10/16] Simplify changelog --- packages/ui/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index 699d4c95c6769d..e71be1fd2123fc 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -4,7 +4,7 @@ ### Breaking Changes -- `Button`: Button children are now wrapped in an inner ``. Custom CSS or event handling that relies on direct-child selectors, such as `.my-button > svg`, or on `event.target` pointing to a child element may need updating. The wrapper layout and loading-content hiding styles only apply to styled variants; `variant="unstyled"` receives the wrapper DOM without the styled wrapper layout, and its loading content is no longer hidden by `@wordpress/ui` styles ([#78820](https://github.com/WordPress/gutenberg/pull/78820)). +- `Button`: Button children are now wrapped in an inner ``. Custom CSS or event handling that relies on direct-child selectors, such as `.my-button > svg`, or on `event.target` pointing to a child element may need updating. The wrapper layout and loading-content hiding styles only apply to styled variants; `variant="unstyled"` receives the wrapper DOM without the styled wrapper layout, and its loading content is no longer hidden ([#78820](https://github.com/WordPress/gutenberg/pull/78820)). ### Enhancements From 840825673507eb0c6f001ffbb8815f134a3c1f0e Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Wed, 17 Jun 2026 02:11:15 +0900 Subject: [PATCH 11/16] Revert accidental keycodes import reorder from merge --- packages/keycodes/src/index.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/keycodes/src/index.ts b/packages/keycodes/src/index.ts index f38e2f33f72097..8c10784d980921 100644 --- a/packages/keycodes/src/index.ts +++ b/packages/keycodes/src/index.ts @@ -15,14 +15,14 @@ import { __ } from '@wordpress/i18n'; /** - * External dependencies + * Internal dependencies */ -import type { KeyboardEvent as ReactKeyboardEvent } from 'react'; +import { isAppleOS } from './platform'; /** - * Internal dependencies + * External dependencies */ -import { isAppleOS } from './platform'; +import type { KeyboardEvent as ReactKeyboardEvent } from 'react'; export type WPModifierPart = | typeof ALT From f85e504796c83dc65b4e416cc52d7db28c7f47c4 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Thu, 18 Jun 2026 23:12:11 +0900 Subject: [PATCH 12/16] Revert Button content wrapper --- packages/ui/src/button/button.tsx | 2 +- packages/ui/src/button/style.module.css | 32 +++++++++++-------------- 2 files changed, 15 insertions(+), 19 deletions(-) diff --git a/packages/ui/src/button/button.tsx b/packages/ui/src/button/button.tsx index def94dd12f2cab..9962c5b9d56502 100644 --- a/packages/ui/src/button/button.tsx +++ b/packages/ui/src/button/button.tsx @@ -55,7 +55,7 @@ export const Button = forwardRef< HTMLButtonElement, ButtonProps >( disabled={ disabled ?? loading } { ...props } > - { children } + { children } ); } diff --git a/packages/ui/src/button/style.module.css b/packages/ui/src/button/style.module.css index 47341c46107662..9030ac8fb2ec88 100644 --- a/packages/ui/src/button/style.module.css +++ b/packages/ui/src/button/style.module.css @@ -10,7 +10,7 @@ .button { /* Internal variables */ - --wp-ui-button-font-weight: 499; + --wp-ui-button-font-weight: var(--wpds-typography-font-weight-medium); --wp-ui-button-background-color: var(--wpds-color-background-interactive-brand-strong); --wp-ui-button-background-color-active: var(--wpds-color-background-interactive-brand-strong-active); @@ -39,6 +39,9 @@ /* Styles */ position: relative; display: inline-flex; + justify-content: center; + align-items: center; + gap: var(--wpds-dimension-gap-sm); aspect-ratio: var(--wp-ui-button-aspect-ratio); min-width: var(--wp-ui-button-min-width); max-width: 100%; @@ -67,7 +70,7 @@ @media not ( prefers-reduced-motion ) { transition: color 0.1s ease-out; - &:not(.is-unstyled) .content { + * { transition: opacity 0.1s ease-out; } } @@ -133,24 +136,9 @@ @media not ( prefers-reduced-motion ) { transition: opacity 0.1s ease-out; } - - @media ( forced-colors: active ) { - border-color: currentColor; - border-block-end-style: none; - border-inline-start-style: none; - } } } - .button:not(.is-unstyled) .content { - display: inline-flex; - flex: 1 1 auto; - justify-content: center; - align-items: center; - gap: var(--wpds-dimension-gap-sm); - min-width: 0; - } - .is-small { --wp-ui-button-padding-block: 0; --wp-ui-button-padding-inline: var(--wpds-dimension-padding-sm); @@ -238,7 +226,15 @@ } .is-loading { - &:not(.is-unstyled) .content { + color: transparent; + + /* Keep text transparent when a loading button is hovered — needed because + the hover state now sets `color` as a property declaration. */ + &:not([data-disabled]):is(:hover, :active, :focus) { + color: transparent; + } + + * { opacity: 0; } From d4bbffe3675cbccfbd49a9ea850e8b5fe935e261 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Thu, 18 Jun 2026 23:16:02 +0900 Subject: [PATCH 13/16] Fix Button loading in forced colors --- packages/ui/src/button/style.module.css | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/ui/src/button/style.module.css b/packages/ui/src/button/style.module.css index 9030ac8fb2ec88..2a7768e2949aed 100644 --- a/packages/ui/src/button/style.module.css +++ b/packages/ui/src/button/style.module.css @@ -136,6 +136,12 @@ @media not ( prefers-reduced-motion ) { transition: opacity 0.1s ease-out; } + + @media ( forced-colors: active ) { + border-color: ButtonText; + border-block-end-style: none; + border-inline-start-style: none; + } } } @@ -225,7 +231,7 @@ --wp-ui-button-height: var(--wpds-dimension-size-md); } - .is-loading { + .is-loading:not(.is-unstyled) { color: transparent; /* Keep text transparent when a loading button is hovered — needed because @@ -234,6 +240,10 @@ color: transparent; } + @media ( forced-colors: active ) { + color: Canvas; + } + * { opacity: 0; } From 6fa5c3fed0e74faf4800263f92b56bd4f64eb0f7 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Thu, 18 Jun 2026 23:25:32 +0900 Subject: [PATCH 14/16] Update changelog --- packages/ui/CHANGELOG.md | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index d16ff9210061a4..b89b7929c40cd0 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -2,10 +2,6 @@ ## Unreleased -### Breaking Changes - -- `Button`: Button children are now wrapped in an inner ``. Custom CSS or event handling that relies on direct-child selectors, such as `.my-button > svg`, or on `event.target` pointing to a child element may need updating. The wrapper layout and loading-content hiding styles only apply to styled variants; `variant="unstyled"` receives the wrapper DOM without the styled wrapper layout, and its loading content is no longer hidden ([#78820](https://github.com/WordPress/gutenberg/pull/78820)). - ### Enhancements - `Field.Description`: Apply `text-wrap: pretty` to description text to avoid typographic widows ([#79143](https://github.com/WordPress/gutenberg/pull/79143)). @@ -19,7 +15,7 @@ ### Bug Fixes -- `Button`: Hide loading content for styled variants and keep the loading spinner visually animated in forced colors mode ([#78820](https://github.com/WordPress/gutenberg/pull/78820)). +- `Button`: Fix `loading` state in forced colors mode ([#78820](https://github.com/WordPress/gutenberg/pull/78820)). ### Internal From 89bf06301b10eb6a03fd8ce47d82fe976c4e1b29 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Fri, 19 Jun 2026 03:26:43 +0900 Subject: [PATCH 15/16] Use ButtonFace for loading text in forced colors --- packages/ui/src/button/style.module.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/ui/src/button/style.module.css b/packages/ui/src/button/style.module.css index 2a7768e2949aed..6be264be7ce576 100644 --- a/packages/ui/src/button/style.module.css +++ b/packages/ui/src/button/style.module.css @@ -241,7 +241,7 @@ } @media ( forced-colors: active ) { - color: Canvas; + color: ButtonFace; } * { From 30a93d7c510485556ab0bf57d5e61fe7f90dfd50 Mon Sep 17 00:00:00 2001 From: Lena Morita Date: Fri, 19 Jun 2026 03:37:09 +0900 Subject: [PATCH 16/16] Add second bug fix to changelog --- packages/ui/CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index b89b7929c40cd0..2829e6bd4c9535 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -16,6 +16,7 @@ ### Bug Fixes - `Button`: Fix `loading` state in forced colors mode ([#78820](https://github.com/WordPress/gutenberg/pull/78820)). +- `Button`: Fix `loading` prop affecting `unstyled` variant ([#78820](https://github.com/WordPress/gutenberg/pull/78820)). ### Internal