Skip to content

Windows High Contrast Mode focus styles - #13944

Open
joedolson wants to merge 14 commits into
WordPress:trunkfrom
joedolson:whcm-focus-styles
Open

joedolson wants to merge 14 commits into
WordPress:trunkfrom
joedolson:whcm-focus-styles

Conversation

@joedolson

@joedolson joedolson commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

In progress ticket to fix issues with Windows High Contrast Mode focus styling.

  • Adminbar search input (no focus state in WHCM)
  • Select inputs .wp-core-ui select has no outline.
  • The use of the deprecated pseudoclass -moz-focusring causes transparent text in select elements on focus. The pseudoclass has been mapped to equate to focus-visible, and shows as that in the inspector; this changed how it impacts the element, and needs to be removed.
  • Adminbar submenu Edit Profile/username combo link (focus state has insufficient height)
  • Select input dropdown arrow remains dark in high contrast mode.
  • All button focus states are very subtle, and hard to spot.
  • Theme browser navigation and close buttons have no :focus state
  • Plugin information tabs missing outline

Trac ticket: https://core.trac.wordpress.org/ticket/45910

Use of AI Tools

None

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.

@github-actions

github-actions Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props joedolson, afercia, therssoftware.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@github-actions

github-actions Bot commented Oct 3, 2026

Copy link
Copy Markdown

Test using WordPress Playground

The 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

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

This override has been mapped to be equivalent to `:focus-visible`, which also changes how it operates, modifying the text color rather than ring color. This causes any support to result in transparent text in high contrast mode
@joedolson

Copy link
Copy Markdown
Contributor Author

I'm inclined to handle the adminbar issue separately, as it will require some more significant adjustments, and is a different class of problem than the others.

@joedolson
joedolson requested a review from afercia October 5, 2026 18:21
@afercia

afercia commented Oct 6, 2026

Copy link
Copy Markdown
Contributor

Test ping to @joedolson

@robelsust

Copy link
Copy Markdown

Code Review

Tested and reviewed PR #13944 across Chrome and Firefox with forced-colors: active emulated and verified against the Core CSS standards.

The implementation is solid:

  • outline: 2px solid transparent cleanly restores focus visibility in WHCM without affecting regular UI styles.
  • Bumping from 1px to 2px brings elements in line with WCAG 2.2 SC 2.4.13 (Focus Appearance) and Core's 2px focus border standards.
  • The forced-colors: active SVG arrow adjustment resolves the dark dropdown arrow issue on dark high contrast themes (Aquatic, Desert, Night Sky).
  • Removing the obsolete -moz-focusring transparent text rule is safe and prevents selected text disappearing in high contrast mode.

Two small observations to finalize this PR:

  1. buttons.css (Fresh color scheme and Login screen):
    The button change in _mixins.scss updates the alternate color schemes, but the default Fresh color scheme and wp-login.php load src/wp-includes/css/buttons.css. In buttons.css, lines 165 (.button:focus) and 292 (.button-primary:focus) still declare outline: 1px solid transparent. Updating those two rules to 2px will ensure buttons are consistently 2px across all admin color schemes and login screens.

  2. Whitespace in _mixins.scss:
    Line 77 in src/wp-admin/css/colors/_mixins.scss has a space before the tabs on /* Visible in Windows High Contrast mode */, which triggers a space before tab in indent warning on git diff --check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants