diff --git a/packages/style-guide/package.json b/packages/style-guide/package.json index 0e1ee48e9..d57244beb 100644 --- a/packages/style-guide/package.json +++ b/packages/style-guide/package.json @@ -11,6 +11,7 @@ "scripts": {}, "dependencies": { "@theme-ui/presets": "workspace:^", + "@theme-ui/color": "workspace:^", "@types/color": "^3.0.3", "color": "^3.1.2", "lodash.get": "^4.4.2" diff --git a/packages/style-guide/src/ColorSwatch.tsx b/packages/style-guide/src/ColorSwatch.tsx index 0577755d6..544f6d7ea 100644 --- a/packages/style-guide/src/ColorSwatch.tsx +++ b/packages/style-guide/src/ColorSwatch.tsx @@ -1,6 +1,7 @@ /** @jsx jsx */ +import { getColor } from '@theme-ui/color' import { ComponentProps } from 'react' -import { jsx, get, ResponsiveStyleValue } from 'theme-ui' +import { jsx, ResponsiveStyleValue } from 'theme-ui' import { toHex } from './color' import { useTheme } from './context' @@ -17,8 +18,8 @@ export const ColorSwatch = ({ label = true, ...props }: ColorSwatchProps) => { - const { colors } = useTheme()! - const value = get(colors!, color) + const theme = useTheme()! + const value = getColor(theme, color) return (