diff --git a/src/common/components/Button/index.tsx b/src/common/components/Button/index.tsx index 35034d2a..583a32c5 100644 --- a/src/common/components/Button/index.tsx +++ b/src/common/components/Button/index.tsx @@ -1,9 +1,10 @@ import { useId, type ButtonHTMLAttributes, type ReactNode } from 'react'; import { Link, To } from 'react-router-dom'; +import { useDevice } from '@hooks/useDevice'; import ButtonLoading from 'views/loadings/ButtonLoading'; -import { container, outsideBox, paddings } from './style.css'; +import { buttonFontVar, container, outsideBox, paddings } from './style.css'; interface ButtonProps extends ButtonHTMLAttributes { children?: ReactNode; @@ -25,6 +26,7 @@ const Button = ({ isLink = false, ...buttonElementProps }: ButtonProps) => { + const DEVICE_TYPE = useDevice(); const { disabled, type = 'button' } = buttonElementProps; const Tag = isLink ? Link : 'button'; @@ -44,7 +46,7 @@ const Button = ({ disabled={isLoading || disabled} {...buttonElementProps}>
+ className={`${container[isLoading || disabled ? 'disabled' : buttonStyle]} ${paddings[padding]} ${buttonFontVar[DEVICE_TYPE]} ${className}`}> {isLoading ? : children}
diff --git a/src/common/components/Button/style.css.ts b/src/common/components/Button/style.css.ts index 880faca5..aa36dfcb 100644 --- a/src/common/components/Button/style.css.ts +++ b/src/common/components/Button/style.css.ts @@ -39,7 +39,6 @@ const containerBase = style({ width: 'fit-content', borderRadius: 12, transition: 'background-color 0.3s ease-out', - ...theme.font.TITLE_5_18_SB, selectors: { '&:disabled, &:disabled:hover': { @@ -122,3 +121,15 @@ export const container = styleVariants({ }, ], }); + +export const buttonFontVar = styleVariants({ + DESK: { + ...theme.font.TITLE_5_18_SB, + }, + TAB: { + ...theme.font.TITLE_5_18_SB, + }, + MOB: { + ...theme.font.TITLE_6_16_SB, + }, +}); diff --git a/src/common/components/Input/components/InputButton/index.tsx b/src/common/components/Input/components/InputButton/index.tsx index 2735430d..5c04357c 100644 --- a/src/common/components/Input/components/InputButton/index.tsx +++ b/src/common/components/Input/components/InputButton/index.tsx @@ -1,12 +1,14 @@ import Button from '@components/Button'; +import { useDevice } from '@hooks/useDevice'; -import { textWidth } from './style.css'; +import { buttonVar } from './style.css'; import { InputButtonProps } from './types'; // TextBox 내부 InputLine 우측 버튼 const InputButton = ({ isLoading, text, ...props }: InputButtonProps) => { + const DEVICE_TYPE = useDevice(); return ( - ); diff --git a/src/common/components/Input/components/InputButton/style.css.ts b/src/common/components/Input/components/InputButton/style.css.ts index f2f1a4f7..d0ba8cd8 100644 --- a/src/common/components/Input/components/InputButton/style.css.ts +++ b/src/common/components/Input/components/InputButton/style.css.ts @@ -1,5 +1,26 @@ -import { style } from '@vanilla-extract/css'; +import { style, styleVariants } from '@vanilla-extract/css'; -export const textWidth = style({ - width: 148, +export const button = style({ + paddingLeft: 0, + paddingRight: 0, +}); +export const buttonVar = styleVariants({ + DESK: [ + button, + { + width: 148, + }, + ], + TAB: [ + button, + { + width: 116, + }, + ], + MOB: [ + button, + { + width: 99, + }, + ], });