diff --git a/lib/components/src/blocks/ColorPalette.tsx b/lib/components/src/blocks/ColorPalette.tsx index 18ca71e335c2..7bf50d6f4970 100644 --- a/lib/components/src/blocks/ColorPalette.tsx +++ b/lib/components/src/blocks/ColorPalette.tsx @@ -53,9 +53,24 @@ const SwatchLabels = styled.div({ flexDirection: 'row', }); -const Swatch = styled.div({ +interface SwatchProps { + background: string; +} + +const Swatch = styled.div(({ background }) => ({ + position: 'relative', flex: 1, -}); + + '&::before': { + position: 'absolute', + top: 0, + left: 0, + width: '100%', + height: '100%', + background, + content: '""', + }, +})); const SwatchColors = styled.div(({ theme }) => ({ ...getBlockBackgroundStyle(theme), @@ -64,6 +79,9 @@ const SwatchColors = styled.div(({ theme }) => ({ height: 50, marginBottom: 5, overflow: 'hidden', + backgroundColor: 'white', + backgroundImage: `repeating-linear-gradient(-45deg, #ccc, #ccc 1px, #fff 1px, #fff 16px)`, + backgroundClip: 'padding-box' })); const SwatchSpecimen = styled.div({ @@ -122,15 +140,7 @@ interface ColorProps { } function renderSwatch(color: string, index: number) { - return ( - - ); + return ; } function renderSwatchLabel(color: string, index: number, colorDescription?: string) {