diff --git a/packages/components/CHANGELOG.md b/packages/components/CHANGELOG.md index ed0073a65c0d0f..9d8b64ce6c563f 100644 --- a/packages/components/CHANGELOG.md +++ b/packages/components/CHANGELOG.md @@ -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 diff --git a/packages/components/src/tab-panel/style.scss b/packages/components/src/tab-panel/style.scss index 1a88fa17b261b4..07830ae5be0c4e 100644 --- a/packages/components/src/tab-panel/style.scss +++ b/packages/components/src/tab-panel/style.scss @@ -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; } }