Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Bug Fixes

- `CustomGradientPicker`: Add state persistence when switching between Linear and Radial Gradient ([#76595](https://github.com/WordPress/gutenberg/pull/76595)).
- `Button`: fix focus styles in High Contrast (forced colors) mode ([#76719](https://github.com/WordPress/gutenberg/pull/76719)).

## 32.4.0 (2026-03-18)

Expand Down
13 changes: 8 additions & 5 deletions packages/components/src/button/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,6 @@
box-shadow: 0 0 0 var(--wp-admin-border-width-focus) $components-color-accent;
}

// Windows High Contrast mode will show this outline, but not the box-shadow.
&:focus {
outline: 3px solid transparent;
}

/**
* Primary button style.
*/
Expand Down Expand Up @@ -276,6 +271,14 @@
}
}

// Windows High Contrast mode will show this outline, but not the box-shadow.
// This rule is placed after variant outline declarations (e.g. is-primary,
// is-secondary, is-tertiary) to ensure it wins by source order at the same
// specificity, while not using `:not(:active)` to avoid outline flicker.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine as for fixing the regression, but I'm not clear on what the "flicker" is that we want to avoid. Rather, I feel like I'm missing visual feedback for button clicks (keyboard/mouse). Isn't it better to hide the outline on :active so we see that the click went through?

CleanShot.2026-03-21.at.05-27-04.mp4

@t-hamano t-hamano Mar 23, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't it better to hide the outline on :active so we see that the click went through?

I think this will also be useful in Windows high-contrast mode. In high-contrast mode, there is no interaction when clicked. If we were to remove the outline in the active state, it would look like this:

6fd3b19b409102d4547565d0e96e1037.mp4

This new behavior might be considered for WP 7.1.

&:focus {
outline: 3px solid transparent;
}

&:not(:disabled, [aria-disabled="true"]):active {
color: $components-color-foreground;
}
Expand Down
Loading