From b507f5945c7e5dd82acd7cf96b45caaff0144d09 Mon Sep 17 00:00:00 2001 From: shlee9999 <95556588+shlee9999@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:29:39 +0900 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9BFix:=20Typo=20color=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Typo/index.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/components/Typo/index.ts b/src/components/Typo/index.ts index 3346479..dd6911f 100644 --- a/src/components/Typo/index.ts +++ b/src/components/Typo/index.ts @@ -1,12 +1,16 @@ -import { FontWeight, GrayscaleColors, styled } from 'styled-components' +import { BrandColors, FontWeight, GrayscaleColors, styled } from 'styled-components' type TypoProps = { - color?: keyof GrayscaleColors + color?: keyof GrayscaleColors | keyof BrandColors weight?: FontWeight } const Typo = styled.p` - color: ${({ color }) => (color ? color : 'inherit')}; + color: ${({ theme, color }) => + theme.colors.grayscale[color as keyof GrayscaleColors] || + theme.colors.brand[color as keyof BrandColors] || + 'inherit'}; + font-weight: ${({ weight }) => (weight ? weight : 400)}; `