Repository navigation
Tab Panel: Show focus with outline instead of legacy box-shadow ring #82421
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
t-hamano
merged 12 commits into
WordPress:trunk
from
yashjawale:fix/focus-ring-tab-panel-80138
Sep 4, 2026
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
5c22fab
feat: use outline for focus for tab panel
yashjawale 8ce55f3
Merge branch 'trunk' into fix/focus-ring-tab-panel-80138
yashjawale fb038fe
Merge branch 'trunk' into fix/focus-ring-tab-panel-80138
yashjawale 50b2814
docs: add changelog entry
yashjawale 8a2a79e
Merge branch 'fix/focus-ring-tab-panel-80138' of https://github.com/y…
yashjawale 03129c3
test: change to trigger changelog workflow
yashjawale f2a4b6b
reset change
yashjawale 2631906
fix: set outline offset to 0 after the mixin
yashjawale 784f2b8
fix: remove box-shadow leftovers
yashjawale d162c61
docs: remove trailing / in PR link in changelog
yashjawale f3df65d
Merge branch 'trunk' into fix/focus-ring-tab-panel-80138
yashjawale 9b7619a
Merge branch 'trunk' into fix/focus-ring-tab-panel-80138
yashjawale File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,5 @@ | ||
| @use "@wordpress/base-styles/variables" as *; | ||
| @use "@wordpress/base-styles/mixins" as *; | ||
|
|
||
| .components-tab-panel__tabs { | ||
| display: flex; | ||
|
|
@@ -16,7 +17,6 @@ | |
| height: $grid-unit-60 !important; // https://github.com/WordPress/gutenberg/pull/65075#discussion_r1746282734 | ||
| background: transparent; | ||
| border: none; | ||
| box-shadow: none; | ||
| cursor: var(--wpds-cursor-control); | ||
| padding: 3px var(--wpds-dimension-padding-lg); // Use padding to offset the is-active border, this benefits Windows High Contrast mode | ||
| margin-left: 0; | ||
|
|
@@ -34,7 +34,6 @@ | |
|
|
||
| &:focus:not(:disabled) { | ||
| position: relative; | ||
| box-shadow: none; | ||
| outline: none; | ||
| } | ||
|
|
||
|
|
@@ -73,24 +72,12 @@ | |
| position: absolute; | ||
| inset: var(--wpds-dimension-padding-md); | ||
| pointer-events: none; | ||
|
|
||
| // Draw the indicator. | ||
| box-shadow: 0 0 0 0 transparent; | ||
| border-radius: var(--wpds-border-radius-sm); | ||
|
|
||
| // Animation | ||
| @media not (prefers-reduced-motion) { | ||
| transition: box-shadow 0.1s linear; | ||
| } | ||
| } | ||
|
|
||
| &:focus-visible::before { | ||
| box-shadow: | ||
| 0 0 0 var(--wpds-border-width-focus) | ||
| var(--wpds-color-stroke-focus); | ||
|
|
||
| // Windows high contrast mode. | ||
| outline: 2px solid transparent; | ||
| @include outset-ring__focus(); | ||
| outline-offset: 0; | ||
| } | ||
|
|
||
| .components-tab-panel__tabs[aria-orientation="vertical"] & { | ||
|
|
@@ -108,17 +95,11 @@ | |
|
|
||
| .components-tab-panel__tab-content { | ||
| &:focus { | ||
| box-shadow: none; | ||
| outline: none; | ||
| } | ||
|
|
||
| &:focus-visible { | ||
| box-shadow: | ||
| 0 0 0 var(--wpds-border-width-focus) | ||
| var(--wpds-color-stroke-focus); | ||
|
|
||
| // Windows high contrast mode. | ||
| outline: 2px solid transparent; | ||
| @include outset-ring__focus(); | ||
| outline-offset: 0; | ||
| } | ||
|
Comment on lines
101
to
104
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here |
||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The mixin also sets
outline-offsetto the focus-ring width, so both rings move farther outward than the previous zero-gap treatment. Could we addoutline-offset: 0after theinclude? That should help to preserve the existing placement while still using the shared outline mixin