Skip to content

Commit fd86df0

Browse files
Merge pull request #38 from SOPT-36-NINEDOT/feat/#36/layoutHeaderFooter
[Feat]: 임시 헤더 및 rem 값 수정
2 parents a3868d5 + 9791966 commit fd86df0

5 files changed

Lines changed: 115 additions & 25 deletions

File tree

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
import { style } from '@vanilla-extract/css';
2+
3+
import { colors } from '@/style/token/color.css';
4+
import { fonts } from '@/style/token/typography.css';
5+
6+
export const header = style({
7+
width: '100%',
8+
backgroundColor: colors.bg_black01,
9+
display: 'flex',
10+
justifyContent: 'center',
11+
});
12+
13+
export const headerInner = style({
14+
width: '100%',
15+
maxWidth: '90rem',
16+
padding: '0.94rem 5rem',
17+
display: 'flex',
18+
justifyContent: 'space-between',
19+
alignItems: 'center',
20+
});
21+
22+
export const logo = style({
23+
color: colors.white01,
24+
...fonts.subtitle05,
25+
});
26+
27+
export const navWrapper = style({
28+
display: 'flex',
29+
gap: '1.25rem',
30+
});
31+
32+
export const navItem = style({
33+
display: 'flex',
34+
padding: '0.75rem 1.25rem',
35+
justifyContent: 'center',
36+
alignItems: 'center',
37+
flexShrink: 0,
38+
color: '#5A5E66', // 추후 토큰 색상으로 변경
39+
textAlign: 'center',
40+
...fonts.subtitle05,
41+
background: 'transparent',
42+
border: 'none',
43+
cursor: 'pointer',
44+
whiteSpace: 'nowrap',
45+
transition: 'color 0.2s',
46+
});
47+
48+
export const active = style({
49+
color: '#FDFDFD',
50+
});
51+
52+
export const profilePlaceholder = style({
53+
width: '3.125rem',
54+
height: '3.125rem',
55+
borderRadius: '50%',
56+
backgroundColor: '#5A5E66', // 추후 토큰 색상으로 변경
57+
flexShrink: 0,
58+
});
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { useState } from 'react';
2+
3+
import * as styles from './Header.css';
4+
5+
const MENUS = ['나의 할 일', '나의 만다르트', '나의 히스토리'];
6+
7+
const Header = () => {
8+
const [activeMenu, setActiveMenu] = useState<string>(MENUS[0]);
9+
10+
return (
11+
<header className={styles.header}>
12+
<div className={styles.headerInner}>
13+
<h1 className={styles.logo}>NINEDOT</h1>
14+
15+
<nav className={styles.navWrapper}>
16+
{MENUS.map((menu) => (
17+
<button
18+
key={menu}
19+
className={`${styles.navItem} ${activeMenu === menu ? styles.active : ''}`}
20+
onClick={() => setActiveMenu(menu)}
21+
aria-current={activeMenu === menu ? 'page' : undefined}
22+
>
23+
{menu}
24+
</button>
25+
))}
26+
</nav>
27+
28+
<div className={styles.profilePlaceholder} />
29+
</div>
30+
</header>
31+
);
32+
};
33+
34+
export default Header;

src/shared/component/Layout/Layout.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
import { Outlet } from 'react-router-dom';
22

3+
import Header from './Header/Header';
4+
35
const Layout = () => {
46
return (
57
<div>
6-
{/* TODO: Header 컴포넌트 추가 */}
7-
<header>
8-
{/* 임시 헤더 */}
9-
<h1>NINEDOT</h1>
10-
</header>
8+
<Header />
119

1210
<main>
1311
<Outlet />

src/style/global.css.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { globalStyle } from '@vanilla-extract/css';
33
import './reset.css.ts';
44

55
globalStyle('html', {
6-
fontSize: '62.5%',
6+
fontSize: '100%',
77
});
88

99
globalStyle('body', {

src/style/token/typography.css.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,96 +1,96 @@
11
export const fonts = {
22
display01: {
3-
fontSize: '5.4rem',
3+
fontSize: '3.375rem', // 54px
44
fontWeight: '700',
55
lineHeight: '140%',
66
},
77
display02: {
8-
fontSize: '2.8rem',
8+
fontSize: '1.75rem', // 28px
99
fontWeight: '700',
1010
lineHeight: '140%',
1111
},
1212
title01: {
13-
fontSize: '2.8rem',
13+
fontSize: '1.75rem', // 28px
1414
fontWeight: '600',
1515
lineHeight: '140%',
1616
},
1717
title02: {
18-
fontSize: '2.8rem',
18+
fontSize: '1.75rem', // 28px
1919
fontWeight: '300',
2020
lineHeight: '140%',
2121
},
2222
title03: {
23-
fontSize: '2.4rem',
23+
fontSize: '1.5rem', // 24px
2424
fontWeight: '700',
2525
lineHeight: '140%',
2626
},
2727
title04: {
28-
fontSize: '2.4rem',
28+
fontSize: '1.5rem', // 24px
2929
fontWeight: '600',
3030
lineHeight: '140%',
3131
},
3232
subtitle01: {
33-
fontSize: '2rem',
33+
fontSize: '1.25rem', // 20px
3434
fontWeight: '700',
3535
lineHeight: '140%',
3636
},
3737
subtitle02: {
38-
fontSize: '2rem',
38+
fontSize: '1.25rem', // 20px
3939
fontWeight: '600',
4040
lineHeight: '140%',
4141
},
4242
subtitle03: {
43-
fontSize: '2rem',
43+
fontSize: '1.25rem', // 20px
4444
fontWeight: '500',
4545
lineHeight: '140%',
4646
},
4747
subtitle04: {
48-
fontSize: '2rem',
48+
fontSize: '1.25rem', // 20px
4949
fontWeight: '400',
5050
lineHeight: '140%',
5151
},
5252
subtitle05: {
53-
fontSize: '1.8rem',
53+
fontSize: '1.125rem', // 18px
5454
fontWeight: '700',
5555
lineHeight: '140%',
5656
},
5757
subtitle06: {
58-
fontSize: '1.8rem',
58+
fontSize: '1.125rem', // 18px
5959
fontWeight: '400',
6060
lineHeight: '140%',
6161
},
6262
body01: {
63-
fontSize: '1.6rem',
63+
fontSize: '1rem', // 16px
6464
fontWeight: '700',
6565
lineHeight: '140%',
6666
},
6767
body02: {
68-
fontSize: '1.6rem',
68+
fontSize: '1rem', // 16px
6969
fontWeight: '500',
7070
lineHeight: '140%',
7171
},
7272
body03: {
73-
fontSize: '1.6rem',
73+
fontSize: '1rem', // 16px
7474
fontWeight: '400',
7575
lineHeight: '140%',
7676
},
7777
body04: {
78-
fontSize: '1.4rem',
78+
fontSize: '0.875rem', // 14px
7979
fontWeight: '700',
8080
lineHeight: '140%',
8181
},
8282
body05: {
83-
fontSize: '1.4rem',
83+
fontSize: '0.875rem', // 14px
8484
fontWeight: '400',
8585
lineHeight: '140%',
8686
},
8787
caption01: {
88-
fontSize: '1.2rem',
88+
fontSize: '0.75rem', // 12px
8989
fontWeight: '700',
9090
lineHeight: '140%',
9191
},
9292
caption02: {
93-
fontSize: '1.2rem',
93+
fontSize: '0.75rem', // 12px
9494
fontWeight: '400',
9595
lineHeight: '140%',
9696
},

0 commit comments

Comments
 (0)