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(drawing): show sub-shadow in color picker control button #1318

Merged
19 changes: 19 additions & 0 deletions src/lib/viewers/controls/color-picker/ColorPickerControl.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
@import '../styles';

@mixin highlight-style {
ChenCodes marked this conversation as resolved.
Show resolved Hide resolved
padding: 8px;
background-color: $fours;
border-radius: 4px;
}

.bp-ColorPickerControl {
position: relative;
display: flex;
Expand All @@ -9,6 +15,13 @@

.bp-ColorPickerControl-button {
@include bp-ControlButton;

&:hover,
ChenCodes marked this conversation as resolved.
Show resolved Hide resolved
&:focus {
.bp-ColorPickerControl-highlight {
@include highlight-style();
ChenCodes marked this conversation as resolved.
Show resolved Hide resolved
}
}
}

.bp-ColorPickerControl-palette {
Expand Down Expand Up @@ -38,6 +51,12 @@
}
}

.bp-ColorPickerControl-highlight {
&.bp-is-open {
ChenCodes marked this conversation as resolved.
Show resolved Hide resolved
@include highlight-style();
}
}

.bp-ColorPickerControl-swatch {
width: 18px;
height: 18px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ export default function ColorPickerControl({
type="button"
{...rest}
>
<div className="bp-ColorPickerControl-swatch" style={{ backgroundColor: activeColor }} />
<div className={classNames('bp-ColorPickerControl-highlight', { 'bp-is-open': isColorPickerToggled })}>
<div className="bp-ColorPickerControl-swatch" style={{ backgroundColor: activeColor }} />
</div>
</button>
<div
className={classNames('bp-ColorPickerControl-palette', { 'bp-is-open': isColorPickerToggled })}
Expand Down