Skip to content

Commit 4b511a6

Browse files
authored
Revert "fix(colorpickers): ColorSwatch focus styling (#1726)"
This reverts commit 7e58e69.
1 parent 7e58e69 commit 4b511a6

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

packages/colorpickers/src/styled/ColorSwatch/StyledColorSwatchInput.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ export const StyledColorSwatchInput = styled.input.attrs({
2121
opacity: 0;
2222
z-index: 1;
2323
margin: 0;
24-
cursor: pointer;
2524
width: 100%;
2625
height: 100%;
2726

packages/colorpickers/src/styled/ColorSwatch/StyledColorSwatchLabel.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
import styled, { DefaultTheme, ThemeProps } from 'styled-components';
99
import { parseToRgb, readableColor } from 'polished';
10-
import { DEFAULT_THEME, focusStyles, retrieveComponentStyles } from '@zendeskgarden/react-theming';
10+
import { DEFAULT_THEME, getColor, retrieveComponentStyles } from '@zendeskgarden/react-theming';
1111
import { StyledButtonPreview } from '../ColorPickerDialog/StyledButtonPreview';
1212
import { IRGBColor } from '../../types';
1313

@@ -18,6 +18,7 @@ interface IStyledColorSwatchLabelProps extends ThemeProps<DefaultTheme> {
1818
}
1919

2020
const colorStyles = (props: IStyledColorSwatchLabelProps) => {
21+
const boxShadow = props.theme.shadows.md(getColor('primaryHue', 600, props.theme, 0.35)!);
2122
const { alpha } = parseToRgb(props.backgroundColor) as IRGBColor;
2223
let foregroundColor;
2324

@@ -33,6 +34,9 @@ const colorStyles = (props: IStyledColorSwatchLabelProps) => {
3334

3435
return `
3536
color: ${foregroundColor};
37+
38+
&[data-garden-focus-visible] {
39+
box-shadow: ${boxShadow};
3640
`;
3741
};
3842

@@ -42,13 +46,11 @@ export const StyledColorSwatchLabel = styled(StyledButtonPreview).attrs({
4246
'data-garden-version': PACKAGE_VERSION
4347
})`
4448
position: relative;
45-
top: 0;
4649
border-radius: ${props => props.theme.borderRadii.md};
50+
cursor: pointer;
4751
4852
${colorStyles};
4953
50-
${props => focusStyles({ theme: props.theme, selector: '&:has(:focus-visible)' })}
51-
5254
${props => retrieveComponentStyles(COMPONENT_ID, props)};
5355
`;
5456

0 commit comments

Comments
 (0)