Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .storybook/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ const config: StorybookConfig = {
],
framework: '@storybook/react-vite',
};
export default config;
export default config;
53 changes: 46 additions & 7 deletions src/shared/ui/Button/Button.variants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,60 @@ import { tv } from 'tailwind-variants';

export const buttonVariants = tv({
base: [
/* layout */
'flex items-center justify-center',
'h-[44px]',
'px-[24px]',
'py-[--padding-m]',
'gap-[--spacing-xxs]',
'rounded-[--radius-l]',
'w-[163px] h-[44px]',
'px-[var(--spacing-xl)] py-[var(--padding-m)]',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

패딩과 같은 것들은 스페이싱에 사용되는 토큰 값을 사용하는 것보다 추가로 padding 전용 토큰 값을 만들어서 사용하는게 더 좋을 것 같습니다! 😄

'gap-[var(--spacing-xxs)]',

/* style */
'rounded-[var(--radius-l)]',
'typo-body-1',
'transition-colors',
'focus:outline-none',
],

variants: {
variant: {
fill: ['bg-gray-900 text-white'],
outline: ['border-2 border-gray-900 text-gray-900'],
fill: [
/* default */
'bg-[var(--color-gray-900)] text-[var(--color-white)]',

/* hover */
'hover:bg-[var(--color-gray-500)]',

/* focus */
'focus:bg-[var(--color-gray-600)] focus:text-[var(--color-white)]',

/* disabled */
'disabled:bg-[var(--color-gray-200)]',
'disabled:text-[var(--color-gray-400)]',
'disabled:cursor-not-allowed',
],

outline: [
/* default */
'bg-transparent',
'border-2',
'border-[var(--color-gray-900)]',
'text-[var(--color-gray-900)]',

/* hover */
'hover:border-[var(--color-gray-500)]',
'hover:text-[var(--color-gray-500)]',

/* focus */
'focus:border-[var(--color-gray-600)]',
'focus:text-[var(--color-gray-600)]',

/* disabled */
'disabled:border-[var(--color-gray-300)]',
'disabled:text-[var(--color-gray-400)]',
'disabled:cursor-not-allowed',
],
},
},

defaultVariants: {
variant: 'fill',
},
Expand Down