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

ColorPalette: Show checkered background through semi-transparent colors #47476

Closed
wants to merge 2 commits into from
Closed
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
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
data-wp-component="VStack"
>
<div
class="components-dropdown"
class="components-dropdown components-color-palette__transparent-background"
tabindex="-1"
>
<button
Expand Down
1 change: 1 addition & 0 deletions packages/components/src/color-palette/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ function UnforwardedColorPalette(
<VStack spacing={ 3 } ref={ forwardedRef } { ...otherProps }>
{ ! disableCustomColors && (
<CustomColorPickerDropdown
className="components-color-palette__transparent-background"
isRenderedInSidebar={ __experimentalIsRenderedInSidebar }
renderContent={ renderCustomColorPicker }
renderToggle={ ( { isOpen, onToggle } ) => (
Expand Down
20 changes: 11 additions & 9 deletions packages/components/src/color-palette/style.scss
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
.components-color-palette__custom-color {
position: relative;
border: none;
background: none;
border-radius: $radius-block-ui;
height: $grid-unit-80;
padding: $grid-unit-15;
font-family: inherit;
width: 100%;
.components-color-palette__transparent-background {
// The background image creates a checkerboard pattern. Ignore rtlcss to
// make it work both in LTR and RTL.
// See https://github.com/WordPress/gutenberg/pull/42510
Expand All @@ -17,6 +9,16 @@
background-position: 0 0, 24px 24px;
/*rtl:end:ignore*/
background-size: calc(2 * 24px) calc(2 * 24px);
}

.components-color-palette__custom-color {
position: relative;
border: none;
background: none;
border-radius: $radius-block-ui;
height: $grid-unit-80;
padding: $grid-unit-15;
font-family: inherit;
box-sizing: border-box;
color: $white;
cursor: pointer;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ exports[`ColorPalette should render a dynamic toolbar of colors 1`] = `
data-wp-component="VStack"
>
<div
class="components-dropdown"
class="components-dropdown components-color-palette__transparent-background"
tabindex="-1"
>
<button
Expand Down