-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: GlobalStyle, styleToken 적용 및 공통 Button 컴포넌트 구현
- Loading branch information
1 parent
89ae5fd
commit 78b1279
Showing
18 changed files
with
215 additions
and
7 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,3 +3,4 @@ | |
*/ | ||
|
||
export * from './Page'; | ||
export * from './sum'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { Global, css } from '@emotion/react'; | ||
import { styleToken } from '@/shared/styles'; | ||
|
||
export const GlobalStyles = () => ( | ||
<Global | ||
styles={css` | ||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: border-box; | ||
} | ||
body { | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: center; | ||
background-color: ${styleToken.color.white}; | ||
margin: 0 auto; | ||
} | ||
`} | ||
/> | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** | ||
* @file Automatically generated by barrelsby. | ||
*/ | ||
|
||
export * from './GlobalStyles'; | ||
export * from './styleToken'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
const colors = { | ||
white: '#fff', | ||
black: '#222', | ||
gray100: '#f7f7f7', | ||
gray200: '#E3E3E3', | ||
gray300: '#C7C7C7', | ||
gray400: '#707070', | ||
gray500: '#262626', | ||
gray600: '#131313', | ||
shadow: 'rgba(0, 0, 0, 0.25)', | ||
background: '#f1f4f8', | ||
} as const; | ||
|
||
const fontSize = { | ||
caption: '12px', | ||
body: '14px', | ||
subtitle: '16px', | ||
title: '18px', | ||
headline: '20px', | ||
display: '24px', | ||
} as const; | ||
|
||
const fontWeight = { | ||
regular: 400, | ||
medium: 500, | ||
bold: 700, | ||
} as const; | ||
|
||
const spacing = { | ||
mt10: '2.5rem', | ||
mt20: '5rem', | ||
mt30: '7.5rem', | ||
mt40: '10rem', | ||
mt50: '12.5rem', | ||
mb10: '2.5rem', | ||
} as const; | ||
|
||
const width = { | ||
w100: '100%', | ||
w75: '75%', | ||
w50: '50%', | ||
w25: '25%', | ||
w15: '15%', | ||
} as const; | ||
|
||
export const zIndex = { | ||
overlay: 1300, | ||
modal: 1400, | ||
popover: 1500, | ||
toast: 1600, | ||
tooltip: 1700, | ||
loading: 1800, | ||
} as const; | ||
|
||
export const styleToken = { | ||
color: colors, | ||
fontSize, | ||
fontWeight, | ||
spacing, | ||
width, | ||
zIndex, | ||
} as const; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { HTMLAttributes } from 'react'; | ||
import { Button } from '@chakra-ui/react'; | ||
import styled from '@emotion/styled'; | ||
import { styleToken } from '@/shared'; | ||
|
||
type ButtonProps = { | ||
type: 'button' | 'submit' | 'reset'; | ||
children: string; | ||
onClick?: () => void; | ||
} & HTMLAttributes<HTMLButtonElement>; | ||
|
||
export const BaseButton = ({ type, children, onClick }: ButtonProps) => ( | ||
<Container> | ||
<Button | ||
type={type} | ||
style={{ | ||
width: '100%', | ||
padding: '15px 23px', | ||
textAlign: 'left', | ||
cursor: 'pointer', | ||
backgroundColor: `${styleToken.color.white}`, | ||
overflow: 'hidden', | ||
}} | ||
onClick={onClick} | ||
> | ||
{children} | ||
</Button> | ||
</Container> | ||
); | ||
|
||
const Container = styled.div` | ||
min-width: 230px; | ||
margin: 20px 0 22px; | ||
border-radius: 10px; | ||
border: 1px solid ${styleToken.color.gray200}; | ||
box-sizing: border-box; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const Input = () => <div>Input</div>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export const Typography = () => <div>Typography</div>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/** | ||
* @file Automatically generated by barrelsby. | ||
*/ | ||
|
||
export * from './BaseButton'; | ||
export * from './Input'; | ||
export * from './Typography'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ | |
"baseUrl": ".", | ||
"paths": { | ||
"@/*": [ | ||
"./src/*" | ||
"src/*" | ||
] | ||
} | ||
}, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters