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

CircularOptionPicker: force swatches to visually render on top of the rest of the component's content #49245

Merged
merged 3 commits into from
Mar 22, 2023
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
5 changes: 5 additions & 0 deletions packages/base-styles/_z-index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,11 @@ $z-layers: (
// Needs to be higher than .components-circular-option-picker__option.is-pressed.
".components-circular-option-picker__option.is-pressed + svg": 2,

// The following two indexes are needed so that the swatches (and their tooltips)
// always render on top of the rest of the component's UI.
".components-circular-option-picker__swatches": 1,
"> *:not(.components-circular-option-picker__swatches)": 0,

// Appear under the customizer heading UI, but over anything else.
".customize-widgets__topbar": 8,

Expand Down
1 change: 1 addition & 0 deletions packages/components/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

### Bug Fix

- `CircularOptionPicker`: force swatches to visually render on top of the rest of the component's content ([#49245](https://github.com/WordPress/gutenberg/pull/49245)).
- `InputControl`: Fix misaligned textarea input control ([#49116](https://github.com/WordPress/gutenberg/pull/49116)).

### Internal
Expand Down
10 changes: 10 additions & 0 deletions packages/components/src/circular-option-picker/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,16 @@ $color-palette-circle-spacing: 12px;
display: flex;
flex-wrap: wrap;
gap: $color-palette-circle-spacing;
position: relative;
z-index: z-index(".components-circular-option-picker__swatches");
}

// Make sure that the .components-circular-option-picker__swatches element
// renders visually on top of its siblings. This is necessary to make sure
// that the tooltip rendered when hovering an `Option` always appears on top.
> *:not(.components-circular-option-picker__swatches) {
position: relative;
z-index: z-index("> *:not(.components-circular-option-picker__swatches)");
}
}

Expand Down