diff --git a/packages/ui/CHANGELOG.md b/packages/ui/CHANGELOG.md index 000d74032c09b6..2829e6bd4c9535 100644 --- a/packages/ui/CHANGELOG.md +++ b/packages/ui/CHANGELOG.md @@ -13,6 +13,11 @@ - Move `@types/react` from `dependencies` to an optional peer dependency so consumers' React type version is used ([#79095](https://github.com/WordPress/gutenberg/pull/79095)). - `Button` and `AlertDialog`: Reference the tone-specific `brand`/`error` disabled color tokens for disabled states instead of the `neutral` ones, to match each element's tone. Disabled `Select`/`Autocomplete`/`Combobox` list items also adopt the `brand` disabled background token. No visual change ([#79124](https://github.com/WordPress/gutenberg/pull/79124)). +### 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 - Adopt `--wpds-dimension-size-*` design tokens [#79093](https://github.com/WordPress/gutenberg/pull/79093). diff --git a/packages/ui/src/button/style.module.css b/packages/ui/src/button/style.module.css index 9030ac8fb2ec88..6be264be7ce576 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: ButtonFace; + } + * { opacity: 0; }