1
1
import { createTheme , createThemeContract } from '@vanilla-extract/css' ;
2
2
3
+ /**
4
+ * 이 변수는 테마의 구조만 정의하며, 실제 값은 없습니다.
5
+ * 실제 테마 값은 아래의 테마 객체에서 확인하세요:
6
+ * - {@link lightTheme} - 라이트 테마 값
7
+ * - {@link darkTheme} - 다크 테마 값
8
+ * - {@link commonThemeValues} - 공통 테마 값
9
+ */
10
+
3
11
export const vars = createThemeContract ( {
4
12
colors : {
5
13
background : null ,
@@ -19,6 +27,7 @@ export const vars = createThemeContract({
19
27
code : null ,
20
28
} ,
21
29
fontSize : {
30
+ xs : null ,
22
31
small : null ,
23
32
base : null ,
24
33
large : null ,
@@ -59,25 +68,19 @@ export const vars = createThemeContract({
59
68
} ,
60
69
} ) ;
61
70
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 = {
75
77
typography : {
76
78
fontFamily : {
77
79
base : 'ui-sans-serif -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif' ,
78
80
code : 'SFMono-Regular, Consolas, "Liberation Mono", Menlo, monospace' ,
79
81
} ,
80
82
fontSize : {
83
+ xs : '0.75rem' ,
81
84
small : '0.875rem' ,
82
85
base : '1rem' ,
83
86
large : '1.25rem' ,
@@ -111,14 +114,41 @@ export const lightTheme = createTheme(vars, {
111
114
md : '0.375rem' ,
112
115
lg : '0.5rem' ,
113
116
} ,
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
+ } ,
114
138
shadows : {
115
139
sm : '0 1px 2px 0 rgba(0, 0, 0, 0.05)' ,
116
140
md : '0 4px 6px -1px rgba(0, 0, 0, 0.1)' ,
117
141
lg : '0 10px 15px -3px rgba(0, 0, 0, 0.1)' ,
118
142
} ,
119
143
} ) ;
120
144
145
+ /**
146
+ * 다크 테마
147
+ *
148
+ * 어두운 배경에 밝은 텍스트를 사용하는 테마입니다.
149
+ */
121
150
export const darkTheme = createTheme ( vars , {
151
+ ...commonThemeValues ,
122
152
colors : {
123
153
background : '#0d1117' ,
124
154
text : '#c9d1d9' ,
@@ -131,45 +161,6 @@ export const darkTheme = createTheme(vars, {
131
161
inline : '#EB5757' ,
132
162
} ,
133
163
} ,
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
- } ,
173
164
shadows : {
174
165
sm : '0 1px 2px 0 rgba(0, 0, 0, 0.05)' ,
175
166
md : '0 3px 4px 0 rgba(0, 0, 0, 0.1)' ,
0 commit comments