Skip to content
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

Make CircularOptionPicker focus styles resilient to button size changes #54196

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
2 changes: 2 additions & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
### Bug Fix

- `PaletteEdit`: Fix padding in RTL languages ([#54034](https://github.com/WordPress/gutenberg/pull/54034)).
- `CircularOptionPicker`: make focus styles resilient to button size changes ([#54196](https://github.com/WordPress/gutenberg/pull/54196)).


### Internal

Expand Down
18 changes: 11 additions & 7 deletions packages/components/src/circular-option-picker/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,19 @@ $color-palette-circle-spacing: 12px;
&:focus {
&::after {
content: "";
border: #{ $border-width * 2 } solid $gray-700;
width: 32px;
height: 32px;
position: absolute;
top: -2px;
left: -2px;
border-radius: $radius-round;
box-shadow: inset 0 0 0 2px $white;

// Make sure it's always centered
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);

// Make sure dimensions account for border width
border: #{ $border-width * 2 } solid $gray-700;
width: calc(100% + #{ ( $border-width * 2 ) * 2 });
height: calc(100% + #{ ( $border-width * 2 ) * 2 });
}
}

Expand All @@ -139,7 +144,6 @@ $color-palette-circle-spacing: 12px;
background: $white;
}


.components-circular-option-picker__dropdown-link-action {
margin-right: $grid-unit-20;

Expand Down