Skip to content

Commit afcf152

Browse files
imb96dlwl98
andauthored
feat: #6 글로벌 스타일 (#18)
Co-authored-by: 이진욱 <[email protected]>
1 parent defff92 commit afcf152

File tree

4 files changed

+68
-0
lines changed

4 files changed

+68
-0
lines changed

index.html

+8
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,14 @@
33
<head>
44
<meta charset="UTF-8" />
55
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
6+
<link
7+
href="https://cdn.jsdelivr.net/npm/[email protected]/reset.min.css"
8+
rel="stylesheet"
9+
/>
10+
<link
11+
href="https://webfontworld.github.io/gmarket/GmarketSans.css"
12+
rel="stylesheet"
13+
/>
614
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
715
<title>픽플</title>
816
</head>

src/App.tsx

+2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
77

88
import { router } from '@routes/router';
99

10+
import GlobalStyle from '@styles/globalStyle';
1011
import { theme } from '@styles/theme';
1112

1213
const queryClient = new QueryClient();
@@ -17,6 +18,7 @@ function App() {
1718
<ThemeProvider theme={theme}>
1819
<RouterProvider router={router} />
1920
<ReactQueryDevtools />
21+
<GlobalStyle />
2022
</ThemeProvider>
2123
</QueryClientProvider>
2224
);

src/styles/emotion.d.ts

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import '@emotion/react';
2+
3+
import { theme } from '@styles/theme';
4+
5+
type Palette = typeof theme.PALETTE;
6+
type Styles = typeof theme.STYLES;
7+
type FontSize = typeof theme.FONT_SIZE;
8+
type FontWeight = typeof theme.FONT_WEIGHT;
9+
type LineHeight = typeof theme.LINE_HEIGHT;
10+
11+
declare module '@emotion/react' {
12+
export interface Theme
13+
extends Palette,
14+
Styles,
15+
FontSize,
16+
FontWeight,
17+
LineHeight {
18+
PALETTE: {
19+
[key in keyof Palette]: string;
20+
};
21+
STYLES: {
22+
[key in keyof Styles]: string;
23+
};
24+
FONT_SIZE: {
25+
[key in keyof FontSize]: string;
26+
};
27+
FONT_WEIGHT: {
28+
[key in keyof FontWeight]: string;
29+
};
30+
LINE_HEIGHT: {
31+
[key in keyof LineHeight]: string;
32+
};
33+
}
34+
}

src/styles/globalStyle.tsx

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Global, css } from '@emotion/react';
2+
3+
const style = css`
4+
* {
5+
box-sizing: border-box;
6+
}
7+
8+
body {
9+
width: 100vw;
10+
height: 100vh;
11+
}
12+
13+
#root {
14+
font-family: 'GmarketSans';
15+
width: 100%;
16+
height: 100%;
17+
margin: 0 auto;
18+
}
19+
`;
20+
const GlobalStyle = () => {
21+
return <Global styles={style} />;
22+
};
23+
24+
export default GlobalStyle;

0 commit comments

Comments
 (0)