@uniai-fe/uds-foundation 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/css.scss +1 -0
- package/package.json +4 -2
- package/src/color/index.scss +2 -0
- package/src/color/primitives.scss +222 -0
- package/src/color/semantic/background.scss +14 -0
- package/src/color/semantic/border.scss +16 -0
- package/src/color/semantic/core.scss +24 -0
- package/src/color/semantic/feedback.scss +16 -0
- package/src/color/semantic/index.scss +7 -0
- package/src/color/semantic/interaction.scss +12 -0
- package/src/color/semantic/label.scss +16 -0
- package/src/color/semantic/surface.scss +17 -0
- package/src/data/color.ts +329 -0
- package/src/data/layout.ts +58 -0
- package/src/data/spacing.ts +33 -0
- package/src/data/tokens.ts +22 -0
- package/src/data/typography.ts +122 -0
- package/src/global.d.ts +4 -0
- package/src/helpers/index.ts +83 -0
- package/src/index.scss +16 -0
- package/src/index.ts +3 -0
- package/src/init/document.scss +13 -0
- package/src/init/reset.scss +306 -0
- package/src/layout/breakpoint.scss +8 -0
- package/src/layout/radius.scss +32 -0
- package/src/layout/size.scss +19 -0
- package/src/spacing/gap.scss +19 -0
- package/src/spacing/padding.scss +15 -0
- package/src/types/theme-tokens.ts +39 -0
- package/src/typography/fonts/assets/inter/InterVariable.woff2 +0 -0
- package/src/typography/fonts/assets/pretendard-jp/PretendardJPVariable.woff2 +0 -0
- package/src/typography/fonts/font-family.scss +28 -0
- package/src/typography/fonts/index.ts +3 -0
- package/src/typography/fonts/inter.ts +33 -0
- package/src/typography/fonts/pretendard.ts +35 -0
- package/src/typography/fonts/types.ts +53 -0
- package/src/typography/styles/body.scss +23 -0
- package/src/typography/styles/caption.scss +13 -0
- package/src/typography/styles/display.scss +18 -0
- package/src/typography/styles/heading.scss +33 -0
- package/src/typography/styles/label.scss +18 -0
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
// 기본 Reset 규칙을 theme.init 레이어에 정의
|
|
2
|
+
@layer theme.init {
|
|
3
|
+
:root {
|
|
4
|
+
-webkit-tap-highlight-color: transparent;
|
|
5
|
+
text-size-adjust: none;
|
|
6
|
+
overflow-wrap: break-word;
|
|
7
|
+
word-break: break-word;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
*,
|
|
11
|
+
*::before,
|
|
12
|
+
*::after {
|
|
13
|
+
margin: 0;
|
|
14
|
+
padding: 0;
|
|
15
|
+
border: 0;
|
|
16
|
+
box-sizing: border-box;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
* {
|
|
20
|
+
letter-spacing: -0.05em;
|
|
21
|
+
flex-shrink: 0;
|
|
22
|
+
overscroll-behavior-y: none;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
*:focus,
|
|
26
|
+
*:focus-within,
|
|
27
|
+
*:focus-visible {
|
|
28
|
+
outline: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
html {
|
|
32
|
+
width: 100%;
|
|
33
|
+
font-size: 10px;
|
|
34
|
+
font-family: var(--font-family-sans);
|
|
35
|
+
background-color: #fff;
|
|
36
|
+
touch-action: manipulation;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
body {
|
|
40
|
+
width: 100%;
|
|
41
|
+
position: relative;
|
|
42
|
+
background: none;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
h1,
|
|
46
|
+
h2,
|
|
47
|
+
h3,
|
|
48
|
+
h4,
|
|
49
|
+
h5,
|
|
50
|
+
h6 {
|
|
51
|
+
margin: 0;
|
|
52
|
+
padding: 0;
|
|
53
|
+
font-weight: 500;
|
|
54
|
+
line-height: 1em;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
strong,
|
|
58
|
+
b {
|
|
59
|
+
font-weight: 700;
|
|
60
|
+
line-height: 1em;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
p,
|
|
64
|
+
span,
|
|
65
|
+
i,
|
|
66
|
+
sup,
|
|
67
|
+
sub,
|
|
68
|
+
del,
|
|
69
|
+
ins,
|
|
70
|
+
s {
|
|
71
|
+
margin: 0;
|
|
72
|
+
padding: 0;
|
|
73
|
+
line-height: 1em;
|
|
74
|
+
word-break: keep-all;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
i,
|
|
78
|
+
address,
|
|
79
|
+
cite,
|
|
80
|
+
em,
|
|
81
|
+
q {
|
|
82
|
+
font-weight: 400;
|
|
83
|
+
font-style: normal;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
blockquote,
|
|
87
|
+
abbr,
|
|
88
|
+
dfn {
|
|
89
|
+
font-weight: 400;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
pre,
|
|
93
|
+
code,
|
|
94
|
+
samp,
|
|
95
|
+
kbd,
|
|
96
|
+
var {
|
|
97
|
+
font-family:
|
|
98
|
+
"Consolas", "Monaco", "Menlo", "DejaVu Sans Mono", SFMono-Regular,
|
|
99
|
+
"Liberation Mono", "Courier New", monospace;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
blockquote,
|
|
103
|
+
q {
|
|
104
|
+
quotes: none;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
blockquote::before,
|
|
108
|
+
blockquote::after,
|
|
109
|
+
q::before,
|
|
110
|
+
q::after {
|
|
111
|
+
content: "";
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
img,
|
|
115
|
+
svg {
|
|
116
|
+
max-width: 100%;
|
|
117
|
+
object-fit: contain;
|
|
118
|
+
perspective: 1;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
li,
|
|
122
|
+
dt,
|
|
123
|
+
dd {
|
|
124
|
+
list-style: none;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
table {
|
|
128
|
+
width: 100%;
|
|
129
|
+
border-collapse: collapse;
|
|
130
|
+
border-spacing: 0;
|
|
131
|
+
table-layout: fixed;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
label {
|
|
135
|
+
display: block;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
legend,
|
|
139
|
+
caption {
|
|
140
|
+
display: none;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
article,
|
|
144
|
+
aside,
|
|
145
|
+
footer,
|
|
146
|
+
header,
|
|
147
|
+
main,
|
|
148
|
+
nav,
|
|
149
|
+
section,
|
|
150
|
+
time,
|
|
151
|
+
audio,
|
|
152
|
+
canvas,
|
|
153
|
+
figure,
|
|
154
|
+
figcaption,
|
|
155
|
+
video,
|
|
156
|
+
meter,
|
|
157
|
+
progress,
|
|
158
|
+
details,
|
|
159
|
+
summary {
|
|
160
|
+
display: block;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
figure {
|
|
164
|
+
position: relative;
|
|
165
|
+
width: fit-content;
|
|
166
|
+
height: fit-content;
|
|
167
|
+
font-size: 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
a {
|
|
171
|
+
display: block;
|
|
172
|
+
color: #333;
|
|
173
|
+
text-decoration: none;
|
|
174
|
+
cursor: pointer;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
input,
|
|
178
|
+
select,
|
|
179
|
+
button,
|
|
180
|
+
textarea {
|
|
181
|
+
display: block;
|
|
182
|
+
max-width: 100%;
|
|
183
|
+
background: transparent;
|
|
184
|
+
border-radius: 0;
|
|
185
|
+
box-shadow: none;
|
|
186
|
+
outline: none;
|
|
187
|
+
caret-color: transparent;
|
|
188
|
+
appearance: none;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
button {
|
|
192
|
+
cursor: pointer;
|
|
193
|
+
font-family: inherit;
|
|
194
|
+
user-select: none;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
textarea {
|
|
198
|
+
resize: none;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
select {
|
|
202
|
+
user-select: none;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
select::-ms-expand {
|
|
206
|
+
opacity: 0;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
input::placeholder,
|
|
210
|
+
textarea::placeholder {
|
|
211
|
+
opacity: 1;
|
|
212
|
+
color: #959595;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
input:focus::placeholder,
|
|
216
|
+
textarea:focus::placeholder {
|
|
217
|
+
color: transparent;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
[type="button"],
|
|
221
|
+
[type="reset"],
|
|
222
|
+
[type="submit"] {
|
|
223
|
+
appearance: button;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
[type="search"] {
|
|
227
|
+
appearance: textfield;
|
|
228
|
+
outline-offset: -2px;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
:-webkit-inner-spin-button,
|
|
232
|
+
::-webkit-outer-spin-button {
|
|
233
|
+
height: auto;
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
::-webkit-search-decoration,
|
|
237
|
+
::-webkit-search-cancel-button {
|
|
238
|
+
appearance: none;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
::-webkit-file-upload-button {
|
|
242
|
+
appearance: button;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
input[type="date"],
|
|
246
|
+
input[type="number"] {
|
|
247
|
+
appearance: none;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
input[type="date"]::-webkit-inner-spin-button,
|
|
251
|
+
input[type="number"]::-webkit-inner-spin-button {
|
|
252
|
+
display: none;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
input[type="date"]::-webkit-calendar-picker-indicator,
|
|
256
|
+
input[type="number"]::-webkit-calendar-picker-indicator {
|
|
257
|
+
opacity: 0;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
input[type="date"]::-webkit-clear-button,
|
|
261
|
+
input[type="number"]::-webkit-clear-button {
|
|
262
|
+
display: none;
|
|
263
|
+
}
|
|
264
|
+
|
|
265
|
+
input[type="date"]::-ms-clear,
|
|
266
|
+
input[type="number"]::-ms-clear {
|
|
267
|
+
display: none;
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
input[type="range"]::-webkit-slider-thumb {
|
|
271
|
+
appearance: none;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
input[type="checkbox"] {
|
|
275
|
+
appearance: checkbox;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
button:disabled {
|
|
279
|
+
cursor: default;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
progress {
|
|
283
|
+
appearance: none;
|
|
284
|
+
border: 1px solid #e1e1e1;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
progress::-webkit-progress-bar {
|
|
288
|
+
background-color: #fff;
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
progress::-webkit-progress-value {
|
|
292
|
+
background-color: grey;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
@media (orientation: landscape) {
|
|
296
|
+
html.mobile-device {
|
|
297
|
+
font-size: 1vw;
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
@media (orientation: portrait) {
|
|
302
|
+
html.mobile-device {
|
|
303
|
+
font-size: 1vw;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
@layer theme.tokens.layout {
|
|
2
|
+
:root {
|
|
3
|
+
// radius (by size)
|
|
4
|
+
--theme-radius-4x4: 1px;
|
|
5
|
+
--theme-radius-8x8: 2px;
|
|
6
|
+
--theme-radius-12x12: 2px;
|
|
7
|
+
--theme-radius-16x16: 2px;
|
|
8
|
+
--theme-radius-20x20: 4px;
|
|
9
|
+
--theme-radius-24x24: 4px;
|
|
10
|
+
--theme-radius-32x32: 4px;
|
|
11
|
+
--theme-radius-40x40: 6px;
|
|
12
|
+
--theme-radius-48x48: 6px;
|
|
13
|
+
--theme-radius-56x56: 8px;
|
|
14
|
+
--theme-radius-64x64: 10px;
|
|
15
|
+
--theme-radius-72x72: 12px;
|
|
16
|
+
--theme-radius-80x80: 16px;
|
|
17
|
+
--theme-radius-96x96: 16px;
|
|
18
|
+
--theme-radius-120x120: 16px;
|
|
19
|
+
|
|
20
|
+
// radius (by level)
|
|
21
|
+
--theme-radius-xxsmall: 1px;
|
|
22
|
+
--theme-radius-xsmall: 2px;
|
|
23
|
+
--theme-radius-small: 4px;
|
|
24
|
+
--theme-radius-medium-1: 6px;
|
|
25
|
+
--theme-radius-medium-2: 6px;
|
|
26
|
+
--theme-radius-medium-3: 8px;
|
|
27
|
+
--theme-radius-medium-4: 10px;
|
|
28
|
+
--theme-radius-large-1: 12px;
|
|
29
|
+
--theme-radius-large-2: 16px;
|
|
30
|
+
--theme-radius-xlarge: 16px;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@layer theme.tokens.layout {
|
|
2
|
+
:root {
|
|
3
|
+
--theme-size-xxsmall: 4px;
|
|
4
|
+
--theme-size-xsmall-1: 8px;
|
|
5
|
+
--theme-size-xsmall-2: 12px;
|
|
6
|
+
--theme-size-xsmall-3: 16px;
|
|
7
|
+
--theme-size-small-1: 20px;
|
|
8
|
+
--theme-size-small-2: 24px;
|
|
9
|
+
--theme-size-small-3: 32px;
|
|
10
|
+
--theme-size-medium-1: 40px;
|
|
11
|
+
--theme-size-medium-2: 48px;
|
|
12
|
+
--theme-size-medium-3: 56px;
|
|
13
|
+
--theme-size-medium-4: 64px;
|
|
14
|
+
--theme-size-large-1: 72px;
|
|
15
|
+
--theme-size-large-2: 80px;
|
|
16
|
+
--theme-size-xlarge-1: 96px;
|
|
17
|
+
--theme-size-xlarge-2: 120px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
@layer theme.tokens.spacing {
|
|
2
|
+
:root {
|
|
3
|
+
--spacing-gap-1: 2px;
|
|
4
|
+
--spacing-gap-2: 4px;
|
|
5
|
+
--spacing-gap-3: 6px;
|
|
6
|
+
--spacing-gap-4: 8px;
|
|
7
|
+
--spacing-gap-5: 12px;
|
|
8
|
+
--spacing-gap-6: 16px;
|
|
9
|
+
--spacing-gap-7: 20px;
|
|
10
|
+
--spacing-gap-8: 24px;
|
|
11
|
+
--spacing-gap-9: 28px;
|
|
12
|
+
--spacing-gap-10: 32px;
|
|
13
|
+
--spacing-gap-11: 36px;
|
|
14
|
+
--spacing-gap-12: 40px;
|
|
15
|
+
--spacing-gap-13: 48px;
|
|
16
|
+
--spacing-gap-14: 64px;
|
|
17
|
+
--spacing-gap-15: 80px;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
@layer theme.tokens.spacing {
|
|
2
|
+
:root {
|
|
3
|
+
--spacing-padding-1: 2px;
|
|
4
|
+
--spacing-padding-2: 4px;
|
|
5
|
+
--spacing-padding-3: 6px;
|
|
6
|
+
--spacing-padding-4: 8px;
|
|
7
|
+
--spacing-padding-5: 12px;
|
|
8
|
+
--spacing-padding-6: 16px;
|
|
9
|
+
--spacing-padding-7: 20px;
|
|
10
|
+
--spacing-padding-8: 24px;
|
|
11
|
+
--spacing-padding-9: 28px;
|
|
12
|
+
--spacing-padding-10: 32px;
|
|
13
|
+
--spacing-padding-11: 40px;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export interface ThemeTypographyVariant {
|
|
2
|
+
readonly size: number;
|
|
3
|
+
readonly line_height: string;
|
|
4
|
+
readonly letter_spacing: number;
|
|
5
|
+
readonly font_weight: number;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export type ThemeColorPrimitive = Record<string, string>;
|
|
9
|
+
export interface ThemeColorSemanticSection {
|
|
10
|
+
readonly [token: string]: string | ThemeColorSemanticSection;
|
|
11
|
+
}
|
|
12
|
+
export type ThemeSpacingScale = Record<string, number>;
|
|
13
|
+
export type ThemeLayoutSizes = Record<string, number>;
|
|
14
|
+
export type ThemeTypographyCategory = Record<string, ThemeTypographyVariant>;
|
|
15
|
+
|
|
16
|
+
export interface ThemeTokens {
|
|
17
|
+
readonly color: {
|
|
18
|
+
readonly primitive: ThemeColorPrimitive;
|
|
19
|
+
readonly semantic: ThemeColorSemanticSection;
|
|
20
|
+
};
|
|
21
|
+
readonly spacing: {
|
|
22
|
+
readonly padding: ThemeSpacingScale;
|
|
23
|
+
readonly gap: ThemeSpacingScale;
|
|
24
|
+
};
|
|
25
|
+
readonly layout: {
|
|
26
|
+
readonly breakpoint: Record<
|
|
27
|
+
"xsmall" | "small" | "medium" | "large",
|
|
28
|
+
number
|
|
29
|
+
>;
|
|
30
|
+
readonly size: ThemeLayoutSizes;
|
|
31
|
+
readonly radius: {
|
|
32
|
+
readonly size: ThemeLayoutSizes;
|
|
33
|
+
readonly level: ThemeLayoutSizes;
|
|
34
|
+
};
|
|
35
|
+
};
|
|
36
|
+
readonly typography: {
|
|
37
|
+
readonly [category: string]: ThemeTypographyCategory;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
Binary file
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
@layer theme.tokens.typography {
|
|
2
|
+
:root {
|
|
3
|
+
// Pretendard 계열 기본 스택
|
|
4
|
+
--font-family-pretendard:
|
|
5
|
+
"Pretendard JP Variable", "Pretendard JP", "Pretendard Variable",
|
|
6
|
+
"Pretendard", "Noto Sans KR", "-apple-system", "BlinkMacSystemFont",
|
|
7
|
+
"Apple SD Gothic Neo", "Segoe UI", "Roboto", "Helvetica",
|
|
8
|
+
"Helvetica Neue", "Apple Color Emoji", "Segoe UI Emoji",
|
|
9
|
+
"Segoe UI Symbol", "Malgun Gothic", "맑은 고딕", "돋움", "dotum",
|
|
10
|
+
"Oxygen", "Oxygen-Sans", "Ubuntu", "Cantarell", "sans-serif";
|
|
11
|
+
|
|
12
|
+
// Inter 계열 기본 스택
|
|
13
|
+
--font-family-inter:
|
|
14
|
+
"InterVariable", "Inter", "-apple-system", "BlinkMacSystemFont",
|
|
15
|
+
"Segoe UI", "Roboto", "Helvetica", "Helvetica Neue", "Apple Color Emoji",
|
|
16
|
+
"Segoe UI Emoji", "Segoe UI Symbol", "Malgun Gothic", "맑은 고딕", "돋움",
|
|
17
|
+
"dotum", "Oxygen", "Oxygen-Sans", "Ubuntu", "Cantarell", "sans-serif";
|
|
18
|
+
|
|
19
|
+
// 시스템 기본 산세리프 스택
|
|
20
|
+
--font-family-system:
|
|
21
|
+
"-apple-system", "BlinkMacSystemFont", "Segoe UI", "Roboto", "Helvetica",
|
|
22
|
+
"Helvetica Neue", "Apple Color Emoji", "Segoe UI Emoji",
|
|
23
|
+
"Segoe UI Symbol", "Malgun Gothic", "맑은 고딕", "돋움", "dotum",
|
|
24
|
+
"Oxygen", "Oxygen-Sans", "Ubuntu", "Cantarell", "sans-serif";
|
|
25
|
+
|
|
26
|
+
--font-family-sans: var(--font-family-pretendard);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createLocalFontOptions, type ThemeFontDefinition } from "./types";
|
|
2
|
+
|
|
3
|
+
const INTER_SRC = "../../fonts/inter/InterVariable.woff2";
|
|
4
|
+
|
|
5
|
+
export const interFont: ThemeFontDefinition = {
|
|
6
|
+
name: "InterVariable",
|
|
7
|
+
family: "InterVariable",
|
|
8
|
+
cssVariable: "--theme-font-family-inter",
|
|
9
|
+
fallbacks: [
|
|
10
|
+
"Inter",
|
|
11
|
+
"-apple-system",
|
|
12
|
+
"BlinkMacSystemFont",
|
|
13
|
+
"Segoe UI",
|
|
14
|
+
"Roboto",
|
|
15
|
+
"Helvetica Neue",
|
|
16
|
+
"Arial",
|
|
17
|
+
"sans-serif",
|
|
18
|
+
],
|
|
19
|
+
display: "swap",
|
|
20
|
+
preload: false,
|
|
21
|
+
sources: [
|
|
22
|
+
{
|
|
23
|
+
filename: INTER_SRC,
|
|
24
|
+
weight: "100 900",
|
|
25
|
+
style: "normal",
|
|
26
|
+
},
|
|
27
|
+
],
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const interLocalFont = createLocalFontOptions(
|
|
31
|
+
interFont,
|
|
32
|
+
import.meta.url,
|
|
33
|
+
);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { createLocalFontOptions, type ThemeFontDefinition } from "./types";
|
|
2
|
+
|
|
3
|
+
const PRETENDARD_SRC = "../../fonts/pretendard-jp/PretendardJPVariable.woff2";
|
|
4
|
+
|
|
5
|
+
export const pretendardFont: ThemeFontDefinition = {
|
|
6
|
+
name: "PretendardJPVariable",
|
|
7
|
+
family: "Pretendard JP Variable",
|
|
8
|
+
cssVariable: "--theme-font-family-pretendard",
|
|
9
|
+
fallbacks: [
|
|
10
|
+
"Pretendard Variable",
|
|
11
|
+
"Pretendard",
|
|
12
|
+
"Inter",
|
|
13
|
+
"-apple-system",
|
|
14
|
+
"BlinkMacSystemFont",
|
|
15
|
+
"Segoe UI",
|
|
16
|
+
"Apple SD Gothic Neo",
|
|
17
|
+
"Noto Sans KR",
|
|
18
|
+
"Malgun Gothic",
|
|
19
|
+
"sans-serif",
|
|
20
|
+
],
|
|
21
|
+
display: "swap",
|
|
22
|
+
preload: true,
|
|
23
|
+
sources: [
|
|
24
|
+
{
|
|
25
|
+
filename: PRETENDARD_SRC,
|
|
26
|
+
weight: "100 900",
|
|
27
|
+
style: "normal",
|
|
28
|
+
},
|
|
29
|
+
],
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const pretendardLocalFont = createLocalFontOptions(
|
|
33
|
+
pretendardFont,
|
|
34
|
+
import.meta.url,
|
|
35
|
+
);
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
export type ThemeFontStyle = "normal" | "italic";
|
|
2
|
+
|
|
3
|
+
export type ThemeFontDisplay =
|
|
4
|
+
| "auto"
|
|
5
|
+
| "block"
|
|
6
|
+
| "swap"
|
|
7
|
+
| "fallback"
|
|
8
|
+
| "optional";
|
|
9
|
+
|
|
10
|
+
export interface ThemeFontSource {
|
|
11
|
+
filename: string;
|
|
12
|
+
weight: string;
|
|
13
|
+
style: ThemeFontStyle;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export interface ThemeFontDefinition {
|
|
17
|
+
name: string;
|
|
18
|
+
family: string;
|
|
19
|
+
cssVariable: string;
|
|
20
|
+
fallbacks: string[];
|
|
21
|
+
display?: ThemeFontDisplay;
|
|
22
|
+
preload?: boolean;
|
|
23
|
+
sources: readonly ThemeFontSource[];
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface NextLocalFontOptions {
|
|
27
|
+
variable: string;
|
|
28
|
+
display?: ThemeFontDisplay;
|
|
29
|
+
fallback: string[];
|
|
30
|
+
preload?: boolean;
|
|
31
|
+
src: ReadonlyArray<{
|
|
32
|
+
path: string;
|
|
33
|
+
weight: string;
|
|
34
|
+
style: ThemeFontStyle;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export function createLocalFontOptions(
|
|
39
|
+
font: ThemeFontDefinition,
|
|
40
|
+
metaUrl: string,
|
|
41
|
+
): NextLocalFontOptions {
|
|
42
|
+
return {
|
|
43
|
+
variable: font.cssVariable,
|
|
44
|
+
display: font.display,
|
|
45
|
+
fallback: font.fallbacks,
|
|
46
|
+
preload: font.preload,
|
|
47
|
+
src: font.sources.map(source => ({
|
|
48
|
+
path: new URL(source.filename, metaUrl).pathname,
|
|
49
|
+
weight: source.weight,
|
|
50
|
+
style: source.style,
|
|
51
|
+
})),
|
|
52
|
+
};
|
|
53
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@layer theme.tokens.typography {
|
|
2
|
+
:root {
|
|
3
|
+
--font-body-large-size: 19px;
|
|
4
|
+
--font-body-large-line-height: 1.5em;
|
|
5
|
+
--font-body-large-letter-spacing: 0px;
|
|
6
|
+
--font-body-large-weight: 600;
|
|
7
|
+
|
|
8
|
+
--font-body-medium-size: 17px;
|
|
9
|
+
--font-body-medium-line-height: 1.5em;
|
|
10
|
+
--font-body-medium-letter-spacing: 0px;
|
|
11
|
+
--font-body-medium-weight: 500;
|
|
12
|
+
|
|
13
|
+
--font-body-small-size: 15px;
|
|
14
|
+
--font-body-small-line-height: 1.5em;
|
|
15
|
+
--font-body-small-letter-spacing: 0px;
|
|
16
|
+
--font-body-small-weight: 400;
|
|
17
|
+
|
|
18
|
+
--font-body-xsmall-size: 13px;
|
|
19
|
+
--font-body-xsmall-line-height: 1.5em;
|
|
20
|
+
--font-body-xsmall-letter-spacing: 0px;
|
|
21
|
+
--font-body-xsmall-weight: 400;
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
@layer theme.tokens.typography {
|
|
2
|
+
:root {
|
|
3
|
+
--font-caption-large-size: 12px;
|
|
4
|
+
--font-caption-large-line-height: 1.5em;
|
|
5
|
+
--font-caption-large-letter-spacing: 0px;
|
|
6
|
+
--font-caption-large-weight: 600;
|
|
7
|
+
|
|
8
|
+
--font-caption-medium-size: 11px;
|
|
9
|
+
--font-caption-medium-line-height: 1.5em;
|
|
10
|
+
--font-caption-medium-letter-spacing: 0px;
|
|
11
|
+
--font-caption-medium-weight: 500;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
@layer theme.tokens.typography {
|
|
2
|
+
:root {
|
|
3
|
+
--font-display-large-size: 60px;
|
|
4
|
+
--font-display-large-line-height: 1.4em;
|
|
5
|
+
--font-display-large-letter-spacing: -0.2px;
|
|
6
|
+
--font-display-large-weight: 700;
|
|
7
|
+
|
|
8
|
+
--font-display-medium-size: 44px;
|
|
9
|
+
--font-display-medium-line-height: 1.4em;
|
|
10
|
+
--font-display-medium-letter-spacing: -0.2px;
|
|
11
|
+
--font-display-medium-weight: 700;
|
|
12
|
+
|
|
13
|
+
--font-display-small-size: 36px;
|
|
14
|
+
--font-display-small-line-height: 1.4em;
|
|
15
|
+
--font-display-small-letter-spacing: -0.2px;
|
|
16
|
+
--font-display-small-weight: 600;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
@layer theme.tokens.typography {
|
|
2
|
+
:root {
|
|
3
|
+
--font-heading-xlarge-size: 40px;
|
|
4
|
+
--font-heading-xlarge-line-height: 1.4em;
|
|
5
|
+
--font-heading-xlarge-letter-spacing: -0.2px;
|
|
6
|
+
--font-heading-xlarge-weight: 600;
|
|
7
|
+
|
|
8
|
+
--font-heading-large-size: 32px;
|
|
9
|
+
--font-heading-large-line-height: 1.4em;
|
|
10
|
+
--font-heading-large-letter-spacing: -0.2px;
|
|
11
|
+
--font-heading-large-weight: 600;
|
|
12
|
+
|
|
13
|
+
--font-heading-medium-size: 24px;
|
|
14
|
+
--font-heading-medium-line-height: 1.4em;
|
|
15
|
+
--font-heading-medium-letter-spacing: 0px;
|
|
16
|
+
--font-heading-medium-weight: 600;
|
|
17
|
+
|
|
18
|
+
--font-heading-small-size: 19px;
|
|
19
|
+
--font-heading-small-line-height: 1.4em;
|
|
20
|
+
--font-heading-small-letter-spacing: 0px;
|
|
21
|
+
--font-heading-small-weight: 600;
|
|
22
|
+
|
|
23
|
+
--font-heading-xsmall-size: 17px;
|
|
24
|
+
--font-heading-xsmall-line-height: 1.5em;
|
|
25
|
+
--font-heading-xsmall-letter-spacing: 0px;
|
|
26
|
+
--font-heading-xsmall-weight: 600;
|
|
27
|
+
|
|
28
|
+
--font-heading-xxsmall-size: 15px;
|
|
29
|
+
--font-heading-xxsmall-line-height: 1.5em;
|
|
30
|
+
--font-heading-xxsmall-letter-spacing: 0px;
|
|
31
|
+
--font-heading-xxsmall-weight: 600;
|
|
32
|
+
}
|
|
33
|
+
}
|