Skip to content

Commit cb5c983

Browse files
committed
refactor: commonThemeValues 분리
1 parent 27bbbd2 commit cb5c983

File tree

1 file changed

+43
-52
lines changed

1 file changed

+43
-52
lines changed

packages/notion-to-jsx/src/styles/theme.css.ts

Lines changed: 43 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
import { createTheme, createThemeContract } from '@vanilla-extract/css';
22

3+
/**
4+
* 이 변수는 테마의 구조만 정의하며, 실제 값은 없습니다.
5+
* 실제 테마 값은 아래의 테마 객체에서 확인하세요:
6+
* - {@link lightTheme} - 라이트 테마 값
7+
* - {@link darkTheme} - 다크 테마 값
8+
* - {@link commonThemeValues} - 공통 테마 값
9+
*/
10+
311
export const vars = createThemeContract({
412
colors: {
513
background: null,
@@ -19,6 +27,7 @@ export const vars = createThemeContract({
1927
code: null,
2028
},
2129
fontSize: {
30+
xs: null,
2231
small: null,
2332
base: null,
2433
large: null,
@@ -59,25 +68,19 @@ export const vars = createThemeContract({
5968
},
6069
});
6170

62-
export const lightTheme = createTheme(vars, {
63-
colors: {
64-
background: '#ffffff',
65-
text: '#37352f',
66-
primary: '#0366d6',
67-
secondary: '#586069',
68-
border: '#e1e4e8',
69-
code: {
70-
background: 'rgba(135,131,120,.1)',
71-
text: '#24292e',
72-
inline: '#EB5757',
73-
},
74-
},
71+
/**
72+
* 공통 테마 값
73+
*
74+
* 라이트 테마와 다크 테마에서 공통으로 사용되는 값들입니다.
75+
*/
76+
const commonThemeValues = {
7577
typography: {
7678
fontFamily: {
7779
base: 'ui-sans-serif -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',
7880
code: 'SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace',
7981
},
8082
fontSize: {
83+
xs: '0.75rem',
8184
small: '0.875rem',
8285
base: '1rem',
8386
large: '1.25rem',
@@ -111,14 +114,41 @@ export const lightTheme = createTheme(vars, {
111114
md: '0.375rem',
112115
lg: '0.5rem',
113116
},
117+
};
118+
119+
/**
120+
* 라이트 테마
121+
*
122+
* 밝은 배경에 어두운 텍스트를 사용하는 기본 테마입니다.
123+
*/
124+
export const lightTheme = createTheme(vars, {
125+
...commonThemeValues,
126+
colors: {
127+
background: '#ffffff',
128+
text: '#37352f',
129+
primary: '#0366d6',
130+
secondary: '#586069',
131+
border: '#e1e4e8',
132+
code: {
133+
background: 'rgba(135,131,120,.1)',
134+
text: '#24292e',
135+
inline: '#EB5757',
136+
},
137+
},
114138
shadows: {
115139
sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
116140
md: '0 4px 6px -1px rgba(0, 0, 0, 0.1)',
117141
lg: '0 10px 15px -3px rgba(0, 0, 0, 0.1)',
118142
},
119143
});
120144

145+
/**
146+
* 다크 테마
147+
*
148+
* 어두운 배경에 밝은 텍스트를 사용하는 테마입니다.
149+
*/
121150
export const darkTheme = createTheme(vars, {
151+
...commonThemeValues,
122152
colors: {
123153
background: '#0d1117',
124154
text: '#c9d1d9',
@@ -131,45 +161,6 @@ export const darkTheme = createTheme(vars, {
131161
inline: '#EB5757',
132162
},
133163
},
134-
typography: {
135-
fontFamily: {
136-
base: 'ui-sans-serif -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif',
137-
code: 'SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace',
138-
},
139-
fontSize: {
140-
small: '0.875rem',
141-
base: '1rem',
142-
large: '1.25rem',
143-
h1: '2rem',
144-
h2: '1.5rem',
145-
h3: '1.25rem',
146-
},
147-
fontWeight: {
148-
normal: '400',
149-
medium: '500',
150-
semibold: '600',
151-
bold: '700',
152-
},
153-
lineHeight: {
154-
tight: '1.25',
155-
base: '1.5',
156-
relaxed: '1.75',
157-
},
158-
},
159-
spacing: {
160-
xxs: '0.125rem',
161-
xs: '0.25rem',
162-
sm: '0.5rem',
163-
base: '0.75rem',
164-
md: '1rem',
165-
lg: '1.5rem',
166-
xl: '2rem',
167-
},
168-
borderRadius: {
169-
sm: '0.25rem',
170-
md: '0.375rem',
171-
lg: '0.5rem',
172-
},
173164
shadows: {
174165
sm: '0 1px 2px 0 rgba(0, 0, 0, 0.05)',
175166
md: '0 3px 4px 0 rgba(0, 0, 0, 0.1)',

0 commit comments

Comments
 (0)