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 @@ -7,6 +7,7 @@
- `Popover`: Widen `offset` to also accept an object with separate main and cross axis offsets. The same applies to `BorderBoxControl`'s `popoverOffset` prop ([#82060](https://github.com/WordPress/gutenberg/pull/82060)).
- `ToolsPanelItem`: Add `defaultShown` to show an optional item that has no value, and an `onShownChange` callback that fires only when the user toggles the item in the panel's menu ([#78010](https://github.com/WordPress/gutenberg/pull/78010)).
- `BorderBoxControl`: render the linked/unlinked toggle in a row alongside the label when a visible label is present, so it lines up with the equivalent toggle on sibling controls. Without a visible label the toggle stays beside the inputs, as before. The visible label is now a `BaseControl.VisualLabel`, so it renders as a `span` rather than a `label` element; it was never associated with an input in either form ([#82163](https://github.com/WordPress/gutenberg/pull/82163)).
- `TabPanel`: Updated to show outline via design system's mixin for focus ring instead of legacy box-shadow implementation ([#82421](https://github.com/WordPress/gutenberg/pull/82421)).

### Bug Fixes

Expand Down
27 changes: 4 additions & 23 deletions packages/components/src/tab-panel/style.scss
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;
Expand All @@ -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;
Expand All @@ -34,7 +34,6 @@

&:focus:not(:disabled) {
position: relative;
box-shadow: none;
outline: none;
}

Expand Down Expand Up @@ -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;
}
Comment on lines 78 to 81

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.

The mixin also sets outline-offset to the focus-ring width, so both rings move farther outward than the previous zero-gap treatment. Could we add outline-offset: 0 after the include? That should help to preserve the existing placement while still using the shared outline mixin


.components-tab-panel__tabs[aria-orientation="vertical"] & {
Expand All @@ -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

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.

Same here

}
Loading