Skip to content

Commit

Permalink
🐛Fix: Typo color 로직
Browse files Browse the repository at this point in the history
  • Loading branch information
shlee9999 committed Nov 21, 2024
1 parent b2e6e26 commit b507f59
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/components/Typo/index.ts
Original file line number Diff line number Diff line change
@@ -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<TypoProps>`
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)};
`

Expand Down

0 comments on commit b507f59

Please sign in to comment.