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 @@ -16,6 +16,7 @@
- `Snackbar`: Show the action's focus ring with the design system's outline instead of a legacy dotted outline, and let `Button`/`ExternalLink` own the ring ([#82640](https://github.com/WordPress/gutenberg/pull/82640)).
- `CircularOptionPicker`: Updated to show outline via design system's mixin for focus ring instead of previous border implementation ([#82521](https://github.com/WordPress/gutenberg/pull/82521)).
- `Autocomplete`: Show focus ring with the design system's outline instead of previous box-shadow implementation ([#82766](https://github.com/WordPress/gutenberg/pull/82766)).
- `CustomGradientPicker`: Show the control point's focus ring with the design system's outline and a contrasting backing to separate it from the gradient ([#82834](https://github.com/WordPress/gutenberg/pull/82834)).

### Bug Fixes

Expand Down
32 changes: 24 additions & 8 deletions packages/components/src/custom-gradient-picker/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -64,17 +64,33 @@ $components-custom-gradient-picker__padding: $grid-unit-20; // 48px container, 1
padding: 0;

// Shadow and stroke.
box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) $white, 0 0 $border-width-focus-fallback 0 rgba($black, 0.25);
box-shadow:
inset 0 0 0 var(--wp-admin-border-width-focus) $white,
0 0 $border-width-focus-fallback 0 rgba($black, 0.25);

// Windows High Contrast mode will show this outline, but not the box-shadow.
outline: 2px solid transparent;

&:focus,
&.is-active {
box-shadow: inset 0 0 0 calc(var(--wp-admin-border-width-focus) * 2) $white, 0 0 $border-width-focus-fallback 0 rgba($black, 0.25);
box-shadow:
inset 0 0 0 calc(var(--wp-admin-border-width-focus) * 2) $white,
0 0 $border-width-focus-fallback 0 rgba($black, 0.25);
}

// Windows High Contrast mode will show this outline, but not the box-shadow.
outline: $border-width-tab solid transparent;
&:focus:not(:active) {
// Back Button's focus outline with 1px of solid color on both sides.
outline-offset: 1px;
box-shadow:
inset 0 0 0 var(--wp-admin-border-width-focus) $white,
0 0 $border-width-focus-fallback 0 rgba($black, 0.25),
0 0 0 calc(var(--wpds-border-width-focus) + 2px)
var(--wpds-color-background-surface-neutral-strong);

&.is-active {
box-shadow:
inset 0 0 0 calc(var(--wp-admin-border-width-focus) * 2)
$white,
0 0 $border-width-focus-fallback 0 rgba($black, 0.25),
0 0 0 calc(var(--wpds-border-width-focus) + 2px)
var(--wpds-color-background-surface-neutral-strong);
}
}
}
}
Expand Down
Loading