Skip to content

Commit

Permalink
feat(ui/react/typography): typography 관련 컴포넌트에 color 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
sukvvon committed Jul 16, 2024
1 parent 48cf576 commit fae45ae
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
import { type RecipeVariants, recipe } from '@vanilla-extract/recipes';
import { heading, textAlign, truncate, wrap } from '../../styles/utilities';
import {
color,
heading,
textAlign,
truncate,
wrap,
} from '../../styles/utilities';

export const headingVariants = recipe({
variants: {
Expand All @@ -8,6 +14,19 @@ export const headingVariants = recipe({
center: [textAlign.center],
right: [textAlign.right],
},
color: {
gray100: [color.gray100],

Check failure on line 18 in packages/ui/react/src/components/typography/heading.styles.css.ts

View workflow job for this annotation

GitHub Actions / check-quality (lint)

Unsafe member access .gray100 on an `any` value
gray200: [color.gray200],

Check failure on line 19 in packages/ui/react/src/components/typography/heading.styles.css.ts

View workflow job for this annotation

GitHub Actions / check-quality (lint)

Unsafe member access .gray200 on an `any` value
gray300: [color.gray300],

Check failure on line 20 in packages/ui/react/src/components/typography/heading.styles.css.ts

View workflow job for this annotation

GitHub Actions / check-quality (lint)

Unsafe member access .gray300 on an `any` value
gray400: [color.gray400],

Check failure on line 21 in packages/ui/react/src/components/typography/heading.styles.css.ts

View workflow job for this annotation

GitHub Actions / check-quality (lint)

Unsafe member access .gray400 on an `any` value
gray500: [color.gray500],

Check failure on line 22 in packages/ui/react/src/components/typography/heading.styles.css.ts

View workflow job for this annotation

GitHub Actions / check-quality (lint)

Unsafe member access .gray500 on an `any` value
gray600: [color.gray600],

Check failure on line 23 in packages/ui/react/src/components/typography/heading.styles.css.ts

View workflow job for this annotation

GitHub Actions / check-quality (lint)

Unsafe member access .gray600 on an `any` value
gray700: [color.gray700],

Check failure on line 24 in packages/ui/react/src/components/typography/heading.styles.css.ts

View workflow job for this annotation

GitHub Actions / check-quality (lint)

Unsafe member access .gray700 on an `any` value
gray800: [color.gray800],

Check failure on line 25 in packages/ui/react/src/components/typography/heading.styles.css.ts

View workflow job for this annotation

GitHub Actions / check-quality (lint)

Unsafe member access .gray800 on an `any` value
gray900: [color.gray900],

Check failure on line 26 in packages/ui/react/src/components/typography/heading.styles.css.ts

View workflow job for this annotation

GitHub Actions / check-quality (lint)

Unsafe member access .gray900 on an `any` value
gray1000: [color.gray1000],
gray1100: [color.gray1100],
},
variant: {
h1bold: [heading.h1Bold],
h1semibold: [heading.h1Semibold],
Expand All @@ -33,6 +52,7 @@ export const headingVariants = recipe({

defaultVariants: {
align: 'left',
color: 'gray1100',
truncate: false,
variant: 'h1bold',
wrap: 'nowrap',
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/react/src/components/typography/heading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const Heading = forwardRef<HeadingProps, 'h1'>(
align,
className,
children,
color,
weight = 'bold',
truncate,
...restProps
Expand All @@ -29,7 +30,7 @@ export const Heading = forwardRef<HeadingProps, 'h1'>(
ref={ref}
className={cx(
'favolink-heading',
styles.headingVariants({ variant, truncate, align }),
styles.headingVariants({ variant, color, truncate, align }),
className,
)}
>
Expand Down
16 changes: 15 additions & 1 deletion packages/ui/react/src/components/typography/text.styles.css.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { type RecipeVariants, recipe } from '@vanilla-extract/recipes';
import { body, textAlign, truncate, wrap } from '../../styles/utilities';
import { body, color, textAlign, truncate, wrap } from '../../styles/utilities';

export const textVariants = recipe({
variants: {
Expand All @@ -8,6 +8,19 @@ export const textVariants = recipe({
center: [textAlign.center],
right: [textAlign.right],
},
color: {
gray100: [color.gray100],
gray200: [color.gray200],
gray300: [color.gray300],
gray400: [color.gray400],
gray500: [color.gray500],
gray600: [color.gray600],
gray700: [color.gray700],
gray800: [color.gray800],
gray900: [color.gray900],
gray1000: [color.gray1000],
gray1100: [color.gray1100],
},
variant: {
'1medium': [body.body1Medium],
'1regular': [body.body1Regular],
Expand All @@ -29,6 +42,7 @@ export const textVariants = recipe({

defaultVariants: {
align: 'left',
color: 'gray1100',
truncate: false,
variant: '2regular',
wrap: 'nowrap',
Expand Down
3 changes: 2 additions & 1 deletion packages/ui/react/src/components/typography/text.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const Text = forwardRef<TextProps, 'span'>(
asChild,
as: Tag = 'span',
align,
color,
wrap,
truncate,
size = 2,
Expand All @@ -42,7 +43,7 @@ export const Text = forwardRef<TextProps, 'span'>(
ref={forwardedRef}
className={cx(
'favolink-text',
styles.textVariants({ align, variant, truncate, wrap }),
styles.textVariants({ align, color, variant, truncate, wrap }),
className,
)}
>
Expand Down

0 comments on commit fae45ae

Please sign in to comment.