File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed
Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1111 "scripts" : {},
1212 "dependencies" : {
1313 "@theme-ui/presets" : " workspace:^" ,
14+ "@theme-ui/color" : " workspace:^" ,
1415 "@types/color" : " ^3.0.3" ,
1516 "color" : " ^3.1.2" ,
1617 "lodash.get" : " ^4.4.2"
Original file line number Diff line number Diff line change 11/** @jsx jsx */
2+ import { getColor } from '@theme-ui/color'
23import { ComponentProps } from 'react'
3- import { jsx , get , ResponsiveStyleValue } from 'theme-ui'
4+ import { jsx , ResponsiveStyleValue } from 'theme-ui'
45import { toHex } from './color'
56import { useTheme } from './context'
67
@@ -17,8 +18,8 @@ export const ColorSwatch = ({
1718 label = true ,
1819 ...props
1920} : ColorSwatchProps ) => {
20- const { colors } = useTheme ( ) !
21- const value = get ( colors ! , color )
21+ const theme = useTheme ( ) !
22+ const value = getColor ( theme , color )
2223 return (
2324 < div { ...props } title = { `${ toHex ( value ) } ` } >
2425 < div
You can’t perform that action at this time.
0 commit comments