@uniai-fe/uds-foundation 0.0.3 → 0.0.5

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.
Files changed (41) hide show
  1. package/css.scss +1 -0
  2. package/package.json +7 -5
  3. package/src/color/index.scss +2 -0
  4. package/src/color/primitives.scss +222 -0
  5. package/src/color/semantic/background.scss +14 -0
  6. package/src/color/semantic/border.scss +16 -0
  7. package/src/color/semantic/core.scss +24 -0
  8. package/src/color/semantic/feedback.scss +16 -0
  9. package/src/color/semantic/index.scss +7 -0
  10. package/src/color/semantic/interaction.scss +12 -0
  11. package/src/color/semantic/label.scss +16 -0
  12. package/src/color/semantic/surface.scss +17 -0
  13. package/src/data/color.ts +329 -0
  14. package/src/data/layout.ts +58 -0
  15. package/src/data/spacing.ts +33 -0
  16. package/src/data/tokens.ts +22 -0
  17. package/src/data/typography.ts +122 -0
  18. package/src/global.d.ts +4 -0
  19. package/src/helpers/index.ts +83 -0
  20. package/src/index.scss +16 -0
  21. package/src/index.ts +3 -0
  22. package/src/init/document.scss +13 -0
  23. package/src/init/reset.scss +306 -0
  24. package/src/layout/breakpoint.scss +8 -0
  25. package/src/layout/radius.scss +32 -0
  26. package/src/layout/size.scss +19 -0
  27. package/src/spacing/gap.scss +19 -0
  28. package/src/spacing/padding.scss +15 -0
  29. package/src/types/theme-tokens.ts +39 -0
  30. package/src/typography/fonts/assets/inter/InterVariable.woff2 +0 -0
  31. package/src/typography/fonts/assets/pretendard-jp/PretendardJPVariable.woff2 +0 -0
  32. package/src/typography/fonts/font-family.scss +28 -0
  33. package/src/typography/fonts/index.ts +3 -0
  34. package/src/typography/fonts/inter.ts +33 -0
  35. package/src/typography/fonts/pretendard.ts +35 -0
  36. package/src/typography/fonts/types.ts +53 -0
  37. package/src/typography/styles/body.scss +23 -0
  38. package/src/typography/styles/caption.scss +13 -0
  39. package/src/typography/styles/display.scss +18 -0
  40. package/src/typography/styles/heading.scss +33 -0
  41. package/src/typography/styles/label.scss +18 -0
@@ -0,0 +1,329 @@
1
+ import type {
2
+ ThemeColorPrimitive,
3
+ ThemeColorSemanticSection,
4
+ } from "../types/theme-tokens";
5
+
6
+ const color_common: ThemeColorPrimitive = {
7
+ common_100: "#fff",
8
+ common_0: "#000",
9
+ } as const;
10
+
11
+ const color_neutral: ThemeColorPrimitive = {
12
+ neutral_10: "#1a1a1a",
13
+ neutral_20: "#333333",
14
+ neutral_30: "#4d4d4d",
15
+ neutral_40: "#666666",
16
+ neutral_45: "#737373",
17
+ neutral_50: "#808080",
18
+ neutral_55: "#8c8c8c",
19
+ neutral_60: "#999999",
20
+ neutral_70: "#b3b3b3",
21
+ neutral_80: "#cccccc",
22
+ neutral_90: "#e6e6e6",
23
+ neutral_95: "#f2f2f2",
24
+ neutral_99: "#fcfcfc",
25
+ } as const;
26
+
27
+ const color_cool_gray: ThemeColorPrimitive = {
28
+ cool_gray_10: "#18191b",
29
+ cool_gray_20: "#313235",
30
+ cool_gray_25: "#3d3f43",
31
+ cool_gray_30: "#494b50",
32
+ cool_gray_35: "#55585e",
33
+ cool_gray_40: "#61656b",
34
+ cool_gray_45: "#6d7178",
35
+ cool_gray_50: "#797e86",
36
+ cool_gray_55: "#878b92",
37
+ cool_gray_60: "#94989e",
38
+ cool_gray_65: "#a1a5aa",
39
+ cool_gray_70: "#afb1b6",
40
+ cool_gray_75: "#bcbec2",
41
+ cool_gray_80: "#cacbce",
42
+ cool_gray_85: "#d7d8db",
43
+ cool_gray_90: "#e4e5e7",
44
+ cool_gray_95: "#f2f2f3",
45
+ cool_gray_99: "#fcfcfd",
46
+ } as const;
47
+
48
+ const color_blue: ThemeColorPrimitive = {
49
+ blue_10: "#001233",
50
+ blue_20: "#002466",
51
+ blue_30: "#003699",
52
+ blue_40: "#0047cc",
53
+ blue_45: "#0050e5",
54
+ blue_50: "#0059ff",
55
+ blue_55: "#1a6aff",
56
+ blue_60: "#337aff",
57
+ blue_70: "#669cff",
58
+ blue_80: "#99bdff",
59
+ blue_90: "#ccdeff",
60
+ blue_95: "#e5eeff",
61
+ blue_99: "#fafcff",
62
+ } as const;
63
+
64
+ const color_purple: ThemeColorPrimitive = {
65
+ purple_10: "#120033",
66
+ purple_20: "#240066",
67
+ purple_30: "#360099",
68
+ purple_40: "#4800cc",
69
+ purple_45: "#5200e5",
70
+ purple_50: "#5b00ff",
71
+ purple_55: "#6c1bff",
72
+ purple_60: "#7b33ff",
73
+ purple_70: "#9c66ff",
74
+ purple_80: "#bd99ff",
75
+ purple_90: "#deccff",
76
+ purple_95: "#efe5ff",
77
+ purple_99: "#fcfaff",
78
+ } as const;
79
+
80
+ const color_magenta: ThemeColorPrimitive = {
81
+ magenta_10: "#32012e",
82
+ magenta_20: "#64025b",
83
+ magenta_30: "#950489",
84
+ magenta_40: "#c705b6",
85
+ magenta_45: "#e005cd",
86
+ magenta_50: "#f906e4",
87
+ magenta_55: "#fa1fe7",
88
+ magenta_60: "#fa38e9",
89
+ magenta_70: "#fb6aef",
90
+ magenta_80: "#fd9bf4",
91
+ magenta_90: "#fecdfa",
92
+ magenta_95: "#fee6fc",
93
+ magenta_99: "#fffafe",
94
+ } as const;
95
+
96
+ const color_pink: ThemeColorPrimitive = {
97
+ pink_10: "#320116",
98
+ pink_20: "#63032b",
99
+ pink_30: "#950441",
100
+ pink_40: "#c70556",
101
+ pink_45: "#e00661",
102
+ pink_50: "#f8076c",
103
+ pink_55: "#f91f7a",
104
+ pink_60: "#fa3889",
105
+ pink_70: "#fb6aa7",
106
+ pink_80: "#fc9cc4",
107
+ pink_90: "#fecde2",
108
+ pink_95: "#fee6f0",
109
+ pink_99: "#fffafc",
110
+ } as const;
111
+
112
+ const color_red: ThemeColorPrimitive = {
113
+ red_10: "#310602",
114
+ red_20: "#610d05",
115
+ red_30: "#921307",
116
+ red_40: "#c21a0a",
117
+ red_45: "#da1d0b",
118
+ red_50: "#f2200d",
119
+ red_55: "#f43625",
120
+ red_60: "#f54d3d",
121
+ red_70: "#f7796e",
122
+ red_80: "#faa69e",
123
+ red_90: "#fcd2cf",
124
+ red_95: "#fde8e7",
125
+ red_99: "#fffafa",
126
+ } as const;
127
+
128
+ const color_orange: ThemeColorPrimitive = {
129
+ orange_10: "#331100",
130
+ orange_20: "#662200",
131
+ orange_30: "#993300",
132
+ orange_40: "#cc4400",
133
+ orange_45: "#e54d00",
134
+ orange_50: "#ff5500",
135
+ orange_55: "#ff661a",
136
+ orange_60: "#ff7733",
137
+ orange_70: "#ff9966",
138
+ orange_80: "#ffbb99",
139
+ orange_90: "#ffddcc",
140
+ orange_95: "#ffeee5",
141
+ orange_99: "#fffcfa",
142
+ } as const;
143
+
144
+ const color_yellow: ThemeColorPrimitive = {
145
+ yellow_10: "#302903",
146
+ yellow_20: "#615205",
147
+ yellow_30: "#917a08",
148
+ yellow_40: "#c2a30a",
149
+ yellow_45: "#dab80b",
150
+ yellow_50: "#f2cc0d",
151
+ yellow_55: "#f4d125",
152
+ yellow_60: "#f5d63d",
153
+ yellow_70: "#f7e06e",
154
+ yellow_80: "#faeb9e",
155
+ yellow_90: "#fcf5cf",
156
+ yellow_95: "#fefae7",
157
+ yellow_99: "#fffefa",
158
+ } as const;
159
+
160
+ const color_lime: ThemeColorPrimitive = {
161
+ lime_10: "#2b3300",
162
+ lime_20: "#556600",
163
+ lime_30: "#809900",
164
+ lime_40: "#aacc00",
165
+ lime_45: "#bfe500",
166
+ lime_50: "#d5ff00",
167
+ lime_55: "#d9ff1a",
168
+ lime_60: "#ddff33",
169
+ lime_70: "#e6ff66",
170
+ lime_80: "#eeff99",
171
+ lime_90: "#f7ffcc",
172
+ lime_95: "#fbffe5",
173
+ lime_99: "#fefffa",
174
+ } as const;
175
+
176
+ const color_green: ThemeColorPrimitive = {
177
+ green_10: "#062d13",
178
+ green_20: "#0d5926",
179
+ green_30: "#138639",
180
+ green_40: "#1ab24d",
181
+ green_45: "#1dc956",
182
+ green_50: "#20df60",
183
+ green_55: "#36e270",
184
+ green_60: "#4de580",
185
+ green_70: "#79ec9f",
186
+ green_80: "#a6f2bf",
187
+ green_90: "#d2f9df",
188
+ green_95: "#e9fcef",
189
+ green_99: "#fbfefc",
190
+ } as const;
191
+
192
+ const color_bright_green: ThemeColorPrimitive = {
193
+ bright_green_10: "#213003",
194
+ bright_green_20: "#426105",
195
+ bright_green_30: "#639108",
196
+ bright_green_40: "#84c10b",
197
+ bright_green_45: "#95da0c",
198
+ bright_green_50: "#a5f20d",
199
+ bright_green_55: "#aef325",
200
+ bright_green_60: "#b7f43e",
201
+ bright_green_70: "#c9f76e",
202
+ bright_green_80: "#dbfa9e",
203
+ bright_green_90: "#edfccf",
204
+ bright_green_95: "#f6fee7",
205
+ bright_green_99: "#fdfffa",
206
+ } as const;
207
+
208
+ const color_teal: ThemeColorPrimitive = {
209
+ teal_10: "#062d20",
210
+ teal_20: "#0d5940",
211
+ teal_30: "#13865f",
212
+ teal_40: "#1ab27f",
213
+ teal_45: "#1dc98f",
214
+ teal_50: "#20df9f",
215
+ teal_55: "#36e2a9",
216
+ teal_60: "#4de5b2",
217
+ teal_70: "#79ecc5",
218
+ teal_80: "#a6f2d9",
219
+ teal_90: "#d2f9ec",
220
+ teal_95: "#e9fcf5",
221
+ teal_99: "#fbfefd",
222
+ } as const;
223
+
224
+ const color_cyan: ThemeColorPrimitive = {
225
+ cyan_10: "#002f33",
226
+ cyan_20: "#005e66",
227
+ cyan_30: "#008c99",
228
+ cyan_40: "#00bbcc",
229
+ cyan_45: "#00d2e5",
230
+ cyan_50: "#00eaff",
231
+ cyan_55: "#1aecff",
232
+ cyan_60: "#33eeff",
233
+ cyan_70: "#66f2ff",
234
+ cyan_80: "#99f7ff",
235
+ cyan_90: "#ccfbff",
236
+ cyan_95: "#e5fdff",
237
+ cyan_99: "#faffff",
238
+ } as const;
239
+
240
+ /**
241
+ * /_context/** 추출본을 참고해 수동으로 동기화한 컬러 토큰이다.
242
+ * SCSS 값과 어긋나면 이 객체를 함께 수정해 문서/검증에 활용한다.
243
+ */
244
+ export const color_primitive: ThemeColorPrimitive = {
245
+ ...color_common,
246
+ ...color_neutral,
247
+ ...color_cool_gray,
248
+ ...color_blue,
249
+ ...color_purple,
250
+ ...color_magenta,
251
+ ...color_pink,
252
+ ...color_red,
253
+ ...color_orange,
254
+ ...color_yellow,
255
+ ...color_lime,
256
+ ...color_green,
257
+ ...color_bright_green,
258
+ ...color_teal,
259
+ ...color_cyan,
260
+ };
261
+
262
+ export const color_semantic: ThemeColorSemanticSection = {
263
+ primary: {
264
+ default: color_primitive.blue_55,
265
+ strong: color_primitive.blue_45,
266
+ heavy: color_primitive.blue_30,
267
+ },
268
+ secondary: {
269
+ default: color_primitive.blue_95,
270
+ strong: color_primitive.blue_90,
271
+ heavy: color_primitive.blue_80,
272
+ },
273
+ tertiary: {
274
+ default: color_primitive.cool_gray_95,
275
+ strong: color_primitive.cool_gray_90,
276
+ heavy: color_primitive.cool_gray_80,
277
+ },
278
+ label: {
279
+ strong: color_primitive.cool_gray_10,
280
+ standard: color_primitive.cool_gray_20,
281
+ neutral: color_primitive.cool_gray_50,
282
+ alternative: color_primitive.cool_gray_70,
283
+ assistive: color_primitive.cool_gray_80,
284
+ disabled: color_primitive.cool_gray_80,
285
+ },
286
+ border: {
287
+ standard: {
288
+ cool_gray: color_primitive.cool_gray_90,
289
+ blue: color_primitive.blue_90,
290
+ strong: color_primitive.cool_gray_75,
291
+ heavy: color_primitive.cool_gray_20,
292
+ alternative: color_primitive.cool_gray_80,
293
+ assistive: color_primitive.cool_gray_90,
294
+ },
295
+ },
296
+ background: {
297
+ standard: {
298
+ cool_gray: color_primitive.cool_gray_99,
299
+ neutral: color_primitive.neutral_99,
300
+ },
301
+ alternative: {
302
+ cool_gray: color_primitive.cool_gray_95,
303
+ neutral: color_primitive.neutral_95,
304
+ },
305
+ },
306
+ surface: {
307
+ static: {
308
+ white: color_primitive.common_100,
309
+ cool_gray: color_primitive.cool_gray_99,
310
+ blue: color_primitive.blue_95,
311
+ },
312
+ neutral: color_primitive.neutral_95,
313
+ standard: color_primitive.cool_gray_95,
314
+ strong: color_primitive.neutral_80,
315
+ heavy: color_primitive.cool_gray_20,
316
+ },
317
+ interaction: {
318
+ static: color_primitive.common_100,
319
+ disabled: color_primitive.cool_gray_95,
320
+ },
321
+ feedback: {
322
+ danger: color_primitive.red_40,
323
+ error: color_primitive.red_45,
324
+ warning: color_primitive.yellow_50,
325
+ success: color_primitive.green_40,
326
+ information: color_primitive.blue_60,
327
+ new: color_primitive.red_50,
328
+ },
329
+ };
@@ -0,0 +1,58 @@
1
+ import type { ThemeTokens } from "../types/theme-tokens";
2
+
3
+ export const layout_breakpoint: ThemeTokens["layout"]["breakpoint"] = {
4
+ xsmall: 0,
5
+ small: 768,
6
+ medium: 992,
7
+ large: 1200,
8
+ };
9
+
10
+ export const layout_size: ThemeTokens["layout"]["size"] = {
11
+ xxsmall: 4,
12
+ xsmall_1: 8,
13
+ xsmall_2: 12,
14
+ xsmall_3: 16,
15
+ small_1: 20,
16
+ small_2: 24,
17
+ small_3: 32,
18
+ medium_1: 40,
19
+ medium_2: 48,
20
+ medium_3: 56,
21
+ medium_4: 64,
22
+ large_1: 72,
23
+ large_2: 80,
24
+ xlarge_1: 96,
25
+ xlarge_2: 120,
26
+ };
27
+
28
+ export const layout_radius = {
29
+ size: {
30
+ size_4x4: 1,
31
+ size_8x8: 2,
32
+ size_12x12: 2,
33
+ size_16x16: 2,
34
+ size_20x20: 4,
35
+ size_24x24: 4,
36
+ size_32x32: 4,
37
+ size_40x40: 6,
38
+ size_48x48: 6,
39
+ size_56x56: 8,
40
+ size_64x64: 10,
41
+ size_72x72: 12,
42
+ size_80x80: 16,
43
+ size_96x96: 16,
44
+ size_120x120: 16,
45
+ },
46
+ level: {
47
+ xxsmall: 1,
48
+ xsmall: 2,
49
+ small: 4,
50
+ medium_1: 6,
51
+ medium_2: 6,
52
+ medium_3: 8,
53
+ medium_4: 10,
54
+ large_1: 12,
55
+ large_2: 16,
56
+ xlarge: 16,
57
+ },
58
+ } as const;
@@ -0,0 +1,33 @@
1
+ import type { ThemeSpacingScale } from "../types/theme-tokens";
2
+
3
+ export const spacing_padding: ThemeSpacingScale = {
4
+ padding_1: 2,
5
+ padding_2: 4,
6
+ padding_3: 6,
7
+ padding_4: 8,
8
+ padding_5: 12,
9
+ padding_6: 16,
10
+ padding_7: 20,
11
+ padding_8: 24,
12
+ padding_9: 28,
13
+ padding_10: 32,
14
+ padding_11: 40,
15
+ };
16
+
17
+ export const spacing_gap: ThemeSpacingScale = {
18
+ gap_1: 2,
19
+ gap_2: 4,
20
+ gap_3: 6,
21
+ gap_4: 8,
22
+ gap_5: 12,
23
+ gap_6: 16,
24
+ gap_7: 20,
25
+ gap_8: 24,
26
+ gap_9: 28,
27
+ gap_10: 32,
28
+ gap_11: 36,
29
+ gap_12: 40,
30
+ gap_13: 48,
31
+ gap_14: 64,
32
+ gap_15: 80,
33
+ };
@@ -0,0 +1,22 @@
1
+ import type { ThemeTokens } from "../types/theme-tokens";
2
+ import { color_primitive, color_semantic } from "./color.js";
3
+ import { spacing_gap, spacing_padding } from "./spacing.js";
4
+ import { layout_breakpoint, layout_radius, layout_size } from "./layout.js";
5
+ import { typography_tokens } from "./typography.js";
6
+
7
+ export const themeTokens: ThemeTokens = {
8
+ color: {
9
+ primitive: color_primitive,
10
+ semantic: color_semantic,
11
+ },
12
+ spacing: {
13
+ padding: spacing_padding,
14
+ gap: spacing_gap,
15
+ },
16
+ layout: {
17
+ breakpoint: layout_breakpoint,
18
+ size: layout_size,
19
+ radius: layout_radius,
20
+ },
21
+ typography: typography_tokens,
22
+ } as const;
@@ -0,0 +1,122 @@
1
+ import type { ThemeTokens } from "../types/theme-tokens";
2
+
3
+ export const typography_tokens: ThemeTokens["typography"] = {
4
+ display: {
5
+ large: {
6
+ size: 60,
7
+ line_height: "1.4em",
8
+ letter_spacing: -0.2,
9
+ font_weight: 700,
10
+ },
11
+ medium: {
12
+ size: 44,
13
+ line_height: "1.4em",
14
+ letter_spacing: -0.2,
15
+ font_weight: 700,
16
+ },
17
+ small: {
18
+ size: 36,
19
+ line_height: "1.4em",
20
+ letter_spacing: -0.2,
21
+ font_weight: 600,
22
+ },
23
+ },
24
+ heading: {
25
+ xlarge: {
26
+ size: 40,
27
+ line_height: "1.4em",
28
+ letter_spacing: -0.2,
29
+ font_weight: 600,
30
+ },
31
+ large: {
32
+ size: 32,
33
+ line_height: "1.4em",
34
+ letter_spacing: -0.2,
35
+ font_weight: 600,
36
+ },
37
+ medium: {
38
+ size: 24,
39
+ line_height: "1.4em",
40
+ letter_spacing: 0,
41
+ font_weight: 600,
42
+ },
43
+ small: {
44
+ size: 19,
45
+ line_height: "1.4em",
46
+ letter_spacing: 0,
47
+ font_weight: 600,
48
+ },
49
+ xsmall: {
50
+ size: 17,
51
+ line_height: "1.5em",
52
+ letter_spacing: 0,
53
+ font_weight: 600,
54
+ },
55
+ xxsmall: {
56
+ size: 15,
57
+ line_height: "1.5em",
58
+ letter_spacing: 0,
59
+ font_weight: 600,
60
+ },
61
+ },
62
+ body: {
63
+ large: {
64
+ size: 19,
65
+ line_height: "1.5em",
66
+ letter_spacing: 0,
67
+ font_weight: 600,
68
+ },
69
+ medium: {
70
+ size: 17,
71
+ line_height: "1.5em",
72
+ letter_spacing: 0,
73
+ font_weight: 500,
74
+ },
75
+ small: {
76
+ size: 15,
77
+ line_height: "1.5em",
78
+ letter_spacing: 0,
79
+ font_weight: 400,
80
+ },
81
+ xsmall: {
82
+ size: 13,
83
+ line_height: "1.5em",
84
+ letter_spacing: 0,
85
+ font_weight: 400,
86
+ },
87
+ },
88
+ label: {
89
+ large: {
90
+ size: 16,
91
+ line_height: "1.5em",
92
+ letter_spacing: 0,
93
+ font_weight: 400,
94
+ },
95
+ medium: {
96
+ size: 14,
97
+ line_height: "1.5em",
98
+ letter_spacing: 0,
99
+ font_weight: 400,
100
+ },
101
+ small: {
102
+ size: 13,
103
+ line_height: "1.5em",
104
+ letter_spacing: 0,
105
+ font_weight: 500,
106
+ },
107
+ },
108
+ caption: {
109
+ large: {
110
+ size: 12,
111
+ line_height: "1.5em",
112
+ letter_spacing: 0,
113
+ font_weight: 600,
114
+ },
115
+ medium: {
116
+ size: 11,
117
+ line_height: "1.5em",
118
+ letter_spacing: 0,
119
+ font_weight: 500,
120
+ },
121
+ },
122
+ };
@@ -0,0 +1,4 @@
1
+ declare module "*.scss" {
2
+ const content: Record<string, string>;
3
+ export default content;
4
+ }
@@ -0,0 +1,83 @@
1
+ import { themeTokens } from "../data/tokens.js";
2
+
3
+ const tokens = themeTokens;
4
+
5
+ const cssVar = (name: string) => `var(--${name})`;
6
+ const kebab = (value: string) => value.replace(/_/g, "-");
7
+ const dropPrefix = (value: string, prefix: string) =>
8
+ value.startsWith(`${prefix}_`) ? value.slice(prefix.length + 1) : value;
9
+
10
+ export type ThemeColorPrimitiveKey = keyof typeof tokens.color.primitive;
11
+
12
+ export function colorPrimitiveHex(key: ThemeColorPrimitiveKey): string {
13
+ return tokens.color.primitive[key];
14
+ }
15
+
16
+ export function colorPrimitiveVar(key: ThemeColorPrimitiveKey): string {
17
+ return cssVar(`color-${kebab(key)}`);
18
+ }
19
+
20
+ export type ThemeSpacingPaddingKey = keyof typeof tokens.spacing.padding;
21
+ export type ThemeSpacingGapKey = keyof typeof tokens.spacing.gap;
22
+
23
+ export function spacingPaddingPx(key: ThemeSpacingPaddingKey): number {
24
+ return tokens.spacing.padding[key];
25
+ }
26
+
27
+ export function spacingPaddingVar(key: ThemeSpacingPaddingKey): string {
28
+ const suffix = kebab(dropPrefix(key, "padding"));
29
+ return cssVar(`spacing-padding-${suffix}`);
30
+ }
31
+
32
+ export function spacingGapPx(key: ThemeSpacingGapKey): number {
33
+ return tokens.spacing.gap[key];
34
+ }
35
+
36
+ export function spacingGapVar(key: ThemeSpacingGapKey): string {
37
+ const suffix = kebab(dropPrefix(key, "gap"));
38
+ return cssVar(`spacing-gap-${suffix}`);
39
+ }
40
+
41
+ export type ThemeLayoutBreakpointKey = keyof typeof tokens.layout.breakpoint;
42
+ export type ThemeLayoutSizeKey = keyof typeof tokens.layout.size;
43
+ export type ThemeLayoutRadiusSizeKey = keyof typeof tokens.layout.radius.size;
44
+ export type ThemeLayoutRadiusLevelKey = keyof typeof tokens.layout.radius.level;
45
+
46
+ export function layoutBreakpointPx(key: ThemeLayoutBreakpointKey): number {
47
+ return tokens.layout.breakpoint[key];
48
+ }
49
+
50
+ export function layoutBreakpointVar(key: ThemeLayoutBreakpointKey): string {
51
+ return cssVar(`theme-breakpoint-${kebab(key)}-start`);
52
+ }
53
+
54
+ export function layoutSizePx(key: ThemeLayoutSizeKey): number {
55
+ return tokens.layout.size[key];
56
+ }
57
+
58
+ export function layoutSizeVar(key: ThemeLayoutSizeKey): string {
59
+ return cssVar(`theme-size-${kebab(key)}`);
60
+ }
61
+
62
+ export function layoutRadiusSizePx(key: ThemeLayoutRadiusSizeKey): number {
63
+ return tokens.layout.radius.size[key];
64
+ }
65
+
66
+ export function layoutRadiusSizeVar(key: ThemeLayoutRadiusSizeKey): string {
67
+ const suffix = kebab(dropPrefix(key, "size"));
68
+ return cssVar(`theme-radius-${suffix}`);
69
+ }
70
+
71
+ export function layoutRadiusLevelPx(key: ThemeLayoutRadiusLevelKey): number {
72
+ return tokens.layout.radius.level[key];
73
+ }
74
+
75
+ export function layoutRadiusLevelVar(key: ThemeLayoutRadiusLevelKey): string {
76
+ return cssVar(`theme-radius-${kebab(key)}`);
77
+ }
78
+
79
+ export type ThemeTypographyCategoryKey = keyof typeof tokens.typography;
80
+
81
+ export function typographyVariants(category: ThemeTypographyCategoryKey) {
82
+ return tokens.typography[category];
83
+ }
package/src/index.scss ADDED
@@ -0,0 +1,16 @@
1
+ @use "./init/reset.scss";
2
+ @use "./init/document.scss";
3
+
4
+ // 각 @use 대상은 내부에서 @layer theme.tokens.* 으로 토큰을 정의한다.
5
+ @use "./color/index.scss";
6
+ @use "./spacing/padding.scss";
7
+ @use "./spacing/gap.scss";
8
+ @use "./layout/breakpoint.scss";
9
+ @use "./layout/size.scss";
10
+ @use "./layout/radius.scss";
11
+ @use "./typography/fonts/font-family.scss";
12
+ @use "./typography/styles/display.scss";
13
+ @use "./typography/styles/heading.scss";
14
+ @use "./typography/styles/body.scss";
15
+ @use "./typography/styles/label.scss";
16
+ @use "./typography/styles/caption.scss";
package/src/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ import "./index.scss";
2
+
3
+ export * from "./typography/fonts";
@@ -0,0 +1,13 @@
1
+ // 문서 루트 영역 기본 레이아웃을 정의
2
+ @layer theme.init {
3
+ html,
4
+ body {
5
+ width: 100%;
6
+ height: 100%;
7
+ position: fixed;
8
+ top: 0;
9
+ left: 0;
10
+ overflow: auto;
11
+ z-index: 0;
12
+ }
13
+ }