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

Fix issue with gradient swatches stacking badly with scrollbar. #25002

Merged
merged 2 commits into from
Sep 2, 2020
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
Original file line number Diff line number Diff line change
Expand Up @@ -32,40 +32,44 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
className="components-circular-option-picker"
>
<div
className="components-circular-option-picker__option-wrapper"
className="components-circular-option-picker__swatches"
>
<button
aria-label="Color: red"
aria-pressed={true}
className="components-button components-circular-option-picker__option is-pressed"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onMouseDown={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": "#f00",
"color": "#f00",
}
}
type="button"
/>
<svg
aria-hidden={true}
fill="#000000"
focusable={false}
height={24}
role="img"
viewBox="0 0 24 24"
width={24}
xmlns="http://www.w3.org/2000/svg"
<div
className="components-circular-option-picker__option-wrapper"
>
<path
d="M9 18.6L3.5 13l1-1L9 16.4l9.5-9.9 1 1z"
<button
aria-label="Color: red"
aria-pressed={true}
className="components-button components-circular-option-picker__option is-pressed"
onBlur={[Function]}
onClick={[Function]}
onFocus={[Function]}
onMouseDown={[Function]}
onMouseEnter={[Function]}
onMouseLeave={[Function]}
style={
Object {
"backgroundColor": "#f00",
"color": "#f00",
}
}
type="button"
/>
</svg>
<svg
aria-hidden={true}
fill="#000000"
focusable={false}
height={24}
role="img"
viewBox="0 0 24 24"
width={24}
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M9 18.6L3.5 13l1-1L9 16.4l9.5-9.9 1 1z"
/>
</svg>
</div>
</div>
<div
className="components-circular-option-picker__custom-clear-wrapper"
Expand Down
4 changes: 3 additions & 1 deletion packages/components/src/circular-option-picker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,9 @@ export default function CircularOptionPicker( {
className
) }
>
{ options }
<div className="components-circular-option-picker__swatches">
{ options }
</div>
{ children }
{ actions && (
<div className="components-circular-option-picker__custom-clear-wrapper">
Expand Down
11 changes: 6 additions & 5 deletions packages/components/src/circular-option-picker/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ $color-palette-circle-spacing: 12px;
.components-circular-option-picker {
display: inline-block;
width: 100%;
margin-right: -10px;

.components-circular-option-picker__custom-clear-wrapper {
display: flex;
justify-content: flex-end;
}

// Account for scrollbar or no scrollbar.
.components-circular-option-picker__swatches {
margin-right: -$grid-unit-20;
}
}

.components-circular-option-picker__option-wrapper {
Expand All @@ -31,11 +37,6 @@ $color-palette-circle-spacing: 12px;
height: 100%;
width: 100%;
}

// Remove right margin on every 6th item so it aligns with gradient control.
&:nth-child(6n+6) {
margin-right: 0;
}
}

.components-circular-option-picker__option-wrapper::before {
Expand Down
Loading