@mandujs/mcp 0.12.2 → 0.13.0
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/README.md +367 -367
- package/package.json +2 -2
- package/src/activity-monitor.ts +847 -847
- package/src/adapters/index.ts +20 -20
- package/src/adapters/monitor-adapter.ts +100 -100
- package/src/adapters/tool-adapter.ts +88 -88
- package/src/executor/error-handler.ts +250 -250
- package/src/executor/index.ts +22 -22
- package/src/executor/tool-executor.ts +148 -148
- package/src/hooks/config-watcher.ts +174 -174
- package/src/hooks/index.ts +23 -23
- package/src/hooks/mcp-hooks.ts +227 -227
- package/src/index.ts +106 -106
- package/src/logging/index.ts +15 -15
- package/src/logging/mcp-transport.ts +134 -134
- package/src/registry/index.ts +13 -13
- package/src/registry/mcp-tool-registry.ts +298 -298
- package/src/resources/skills/guides.ts +1136 -1136
- package/src/resources/skills/index.ts +12 -12
- package/src/resources/skills/loader.ts +218 -218
- package/src/resources/skills/mandu-composition/SKILL.md +91 -91
- package/src/resources/skills/mandu-composition/metadata.json +13 -13
- package/src/resources/skills/mandu-composition/rules/_sections.md +26 -26
- package/src/resources/skills/mandu-composition/rules/_template.md +77 -77
- package/src/resources/skills/mandu-composition/rules/comp-arch-avoid-boolean-props.md +146 -146
- package/src/resources/skills/mandu-composition/rules/comp-arch-compound-components.md +164 -164
- package/src/resources/skills/mandu-composition/rules/comp-island-event.md +161 -161
- package/src/resources/skills/mandu-composition/rules/comp-island-slot-split.md +167 -167
- package/src/resources/skills/mandu-composition/rules/comp-pattern-children.md +149 -149
- package/src/resources/skills/mandu-composition/rules/comp-state-context-interface.md +148 -148
- package/src/resources/skills/mandu-composition/rules/comp-state-lift-state.md +150 -150
- package/src/resources/skills/mandu-deployment/SKILL.md +92 -92
- package/src/resources/skills/mandu-deployment/_sections.md +41 -41
- package/src/resources/skills/mandu-deployment/_template.md +38 -38
- package/src/resources/skills/mandu-deployment/metadata.json +13 -13
- package/src/resources/skills/mandu-deployment/rules/deploy-build-bun.md +109 -109
- package/src/resources/skills/mandu-deployment/rules/deploy-build-output.md +115 -115
- package/src/resources/skills/mandu-deployment/rules/deploy-cicd-github.md +219 -219
- package/src/resources/skills/mandu-deployment/rules/deploy-docker-bun.md +150 -150
- package/src/resources/skills/mandu-deployment/rules/deploy-docker-compose.md +223 -223
- package/src/resources/skills/mandu-deployment/rules/deploy-platform-fly.md +152 -152
- package/src/resources/skills/mandu-deployment/rules/deploy-platform-render.md +179 -179
- package/src/resources/skills/mandu-deployment/rules/deploy-platform-supabase.md +323 -323
- package/src/resources/skills/mandu-deployment/rules/deploy-platform-vercel.md +140 -140
- package/src/resources/skills/mandu-fs-routes/SKILL.md +82 -82
- package/src/resources/skills/mandu-fs-routes/metadata.json +12 -12
- package/src/resources/skills/mandu-fs-routes/rules/_sections.md +36 -36
- package/src/resources/skills/mandu-fs-routes/rules/_template.md +69 -69
- package/src/resources/skills/mandu-fs-routes/rules/routes-api-methods.md +65 -65
- package/src/resources/skills/mandu-fs-routes/rules/routes-dynamic-param.md +93 -93
- package/src/resources/skills/mandu-fs-routes/rules/routes-naming-page.md +55 -55
- package/src/resources/skills/mandu-guard/SKILL.md +129 -129
- package/src/resources/skills/mandu-guard/metadata.json +12 -12
- package/src/resources/skills/mandu-guard/rules/_sections.md +36 -36
- package/src/resources/skills/mandu-guard/rules/_template.md +82 -82
- package/src/resources/skills/mandu-guard/rules/guard-config-rules.md +100 -100
- package/src/resources/skills/mandu-guard/rules/guard-layer-direction.md +76 -76
- package/src/resources/skills/mandu-guard/rules/guard-preset-mandu.md +81 -81
- package/src/resources/skills/mandu-guard/rules/guard-validate-import.md +80 -80
- package/src/resources/skills/mandu-hydration/SKILL.md +91 -91
- package/src/resources/skills/mandu-hydration/metadata.json +12 -12
- package/src/resources/skills/mandu-hydration/rules/_sections.md +31 -31
- package/src/resources/skills/mandu-hydration/rules/_template.md +72 -72
- package/src/resources/skills/mandu-hydration/rules/hydration-data-event.md +109 -109
- package/src/resources/skills/mandu-hydration/rules/hydration-directive-use-client.md +55 -55
- package/src/resources/skills/mandu-hydration/rules/hydration-island-setup.md +113 -113
- package/src/resources/skills/mandu-hydration/rules/hydration-priority-visible.md +68 -68
- package/src/resources/skills/mandu-performance/SKILL.md +85 -85
- package/src/resources/skills/mandu-performance/metadata.json +14 -14
- package/src/resources/skills/mandu-performance/rules/_sections.md +31 -31
- package/src/resources/skills/mandu-performance/rules/_template.md +64 -64
- package/src/resources/skills/mandu-performance/rules/perf-async-defer-await.md +103 -103
- package/src/resources/skills/mandu-performance/rules/perf-async-parallel.md +95 -95
- package/src/resources/skills/mandu-performance/rules/perf-bun-file.md +124 -124
- package/src/resources/skills/mandu-performance/rules/perf-bun-serve.md +125 -125
- package/src/resources/skills/mandu-performance/rules/perf-bundle-imports.md +80 -80
- package/src/resources/skills/mandu-performance/rules/perf-bundle-island-lazy.md +145 -145
- package/src/resources/skills/mandu-performance/rules/perf-cache-react.md +98 -98
- package/src/resources/skills/mandu-performance/rules/perf-render-transitions.md +154 -154
- package/src/resources/skills/mandu-security/SKILL.md +87 -87
- package/src/resources/skills/mandu-security/metadata.json +13 -13
- package/src/resources/skills/mandu-security/rules/_sections.md +31 -31
- package/src/resources/skills/mandu-security/rules/_template.md +74 -74
- package/src/resources/skills/mandu-security/rules/sec-auth-guard.md +127 -127
- package/src/resources/skills/mandu-security/rules/sec-env-management.md +133 -133
- package/src/resources/skills/mandu-security/rules/sec-input-validate.md +148 -148
- package/src/resources/skills/mandu-security/rules/sec-protect-csrf.md +146 -146
- package/src/resources/skills/mandu-security/rules/sec-protect-headers.md +138 -138
- package/src/resources/skills/mandu-slot/SKILL.md +85 -85
- package/src/resources/skills/mandu-slot/metadata.json +12 -12
- package/src/resources/skills/mandu-slot/rules/_sections.md +36 -36
- package/src/resources/skills/mandu-slot/rules/_template.md +63 -63
- package/src/resources/skills/mandu-slot/rules/slot-basic-structure.md +38 -38
- package/src/resources/skills/mandu-slot/rules/slot-ctx-response.md +56 -56
- package/src/resources/skills/mandu-slot/rules/slot-guard-auth.md +59 -59
- package/src/resources/skills/mandu-slot/rules/slot-http-methods.md +64 -64
- package/src/resources/skills/mandu-styling/SKILL.md +154 -154
- package/src/resources/skills/mandu-styling/_sections.md +43 -43
- package/src/resources/skills/mandu-styling/_template.md +32 -32
- package/src/resources/skills/mandu-styling/metadata.json +15 -15
- package/src/resources/skills/mandu-styling/rules/style-component-compound.md +235 -235
- package/src/resources/skills/mandu-styling/rules/style-component-slots.md +255 -255
- package/src/resources/skills/mandu-styling/rules/style-component-tokens.md +205 -205
- package/src/resources/skills/mandu-styling/rules/style-island-animations.md +272 -272
- package/src/resources/skills/mandu-styling/rules/style-island-scoping.md +167 -167
- package/src/resources/skills/mandu-styling/rules/style-island-variants.md +221 -221
- package/src/resources/skills/mandu-styling/rules/style-perf-critical.md +209 -209
- package/src/resources/skills/mandu-styling/rules/style-perf-purge.md +192 -192
- package/src/resources/skills/mandu-styling/rules/style-setup-modules.md +162 -162
- package/src/resources/skills/mandu-styling/rules/style-setup-panda.md +164 -164
- package/src/resources/skills/mandu-styling/rules/style-setup-tailwind.md +170 -170
- package/src/resources/skills/mandu-styling/rules/style-tailwind-v4-gotchas.md +179 -179
- package/src/resources/skills/mandu-styling/rules/style-theme-darkmode.md +229 -229
- package/src/resources/skills/mandu-testing/SKILL.md +99 -99
- package/src/resources/skills/mandu-testing/metadata.json +13 -13
- package/src/resources/skills/mandu-testing/rules/_sections.md +26 -26
- package/src/resources/skills/mandu-testing/rules/_template.md +65 -65
- package/src/resources/skills/mandu-testing/rules/test-component-island.md +195 -195
- package/src/resources/skills/mandu-testing/rules/test-e2e-playwright.md +196 -196
- package/src/resources/skills/mandu-testing/rules/test-mock-fetch.md +219 -219
- package/src/resources/skills/mandu-testing/rules/test-slot-unit.md +192 -192
- package/src/resources/skills/mandu-ui/SKILL.md +117 -117
- package/src/resources/skills/mandu-ui/_sections.md +23 -23
- package/src/resources/skills/mandu-ui/_template.md +32 -32
- package/src/resources/skills/mandu-ui/metadata.json +13 -13
- package/src/resources/skills/mandu-ui/rules/ui-accessibility-aria.md +232 -232
- package/src/resources/skills/mandu-ui/rules/ui-accessibility-focus.md +238 -238
- package/src/resources/skills/mandu-ui/rules/ui-composition-patterns.md +259 -259
- package/src/resources/skills/mandu-ui/rules/ui-island-integration.md +258 -258
- package/src/resources/skills/mandu-ui/rules/ui-radix-patterns.md +213 -213
- package/src/resources/skills/mandu-ui/rules/ui-shadcn-setup.md +209 -209
- package/src/resources/skills/recipes.ts +932 -932
- package/src/tools/generate.ts +7 -4
- package/src/tools/guard.ts +17 -4
- package/src/tools/hydration.ts +10 -10
- package/src/tools/project.ts +334 -334
- package/src/tools/runtime.ts +497 -497
- package/src/tools/seo.ts +417 -417
- package/src/tools/spec.ts +80 -159
- package/src/utils/project.ts +22 -12
- package/src/utils/withWarnings.ts +83 -83
|
@@ -1,205 +1,205 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Design Tokens
|
|
3
|
-
impact: HIGH
|
|
4
|
-
impactDescription: Consistent design system foundation
|
|
5
|
-
tags: styling, tokens, design-system, variables
|
|
6
|
-
---
|
|
7
|
-
|
|
8
|
-
## Design Tokens
|
|
9
|
-
|
|
10
|
-
**Impact: HIGH (Consistent design system foundation)**
|
|
11
|
-
|
|
12
|
-
디자인 토큰을 사용하여 일관된 스타일 시스템을 구축하세요.
|
|
13
|
-
|
|
14
|
-
## CSS Variables 기반 토큰
|
|
15
|
-
|
|
16
|
-
```css
|
|
17
|
-
/* app/globals.css */
|
|
18
|
-
@layer base {
|
|
19
|
-
:root {
|
|
20
|
-
/* Colors - HSL format for opacity support */
|
|
21
|
-
--mandu-background: 0 0% 100%;
|
|
22
|
-
--mandu-foreground: 222.2 84% 4.9%;
|
|
23
|
-
|
|
24
|
-
--mandu-card: 0 0% 100%;
|
|
25
|
-
--mandu-card-foreground: 222.2 84% 4.9%;
|
|
26
|
-
|
|
27
|
-
--mandu-primary: 221.2 83.2% 53.3%;
|
|
28
|
-
--mandu-primary-foreground: 210 40% 98%;
|
|
29
|
-
|
|
30
|
-
--mandu-secondary: 210 40% 96.1%;
|
|
31
|
-
--mandu-secondary-foreground: 222.2 47.4% 11.2%;
|
|
32
|
-
|
|
33
|
-
--mandu-muted: 210 40% 96.1%;
|
|
34
|
-
--mandu-muted-foreground: 215.4 16.3% 46.9%;
|
|
35
|
-
|
|
36
|
-
--mandu-accent: 210 40% 96.1%;
|
|
37
|
-
--mandu-accent-foreground: 222.2 47.4% 11.2%;
|
|
38
|
-
|
|
39
|
-
--mandu-destructive: 0 84.2% 60.2%;
|
|
40
|
-
--mandu-destructive-foreground: 210 40% 98%;
|
|
41
|
-
|
|
42
|
-
--mandu-border: 214.3 31.8% 91.4%;
|
|
43
|
-
--mandu-input: 214.3 31.8% 91.4%;
|
|
44
|
-
--mandu-ring: 221.2 83.2% 53.3%;
|
|
45
|
-
|
|
46
|
-
/* Spacing */
|
|
47
|
-
--mandu-spacing-xs: 0.25rem;
|
|
48
|
-
--mandu-spacing-sm: 0.5rem;
|
|
49
|
-
--mandu-spacing-md: 1rem;
|
|
50
|
-
--mandu-spacing-lg: 1.5rem;
|
|
51
|
-
--mandu-spacing-xl: 2rem;
|
|
52
|
-
|
|
53
|
-
/* Typography */
|
|
54
|
-
--mandu-font-sans: ui-sans-serif, system-ui, sans-serif;
|
|
55
|
-
--mandu-font-mono: ui-monospace, monospace;
|
|
56
|
-
|
|
57
|
-
--mandu-text-xs: 0.75rem;
|
|
58
|
-
--mandu-text-sm: 0.875rem;
|
|
59
|
-
--mandu-text-base: 1rem;
|
|
60
|
-
--mandu-text-lg: 1.125rem;
|
|
61
|
-
--mandu-text-xl: 1.25rem;
|
|
62
|
-
|
|
63
|
-
/* Borders */
|
|
64
|
-
--mandu-radius-sm: 0.25rem;
|
|
65
|
-
--mandu-radius-md: 0.5rem;
|
|
66
|
-
--mandu-radius-lg: 0.75rem;
|
|
67
|
-
--mandu-radius-full: 9999px;
|
|
68
|
-
|
|
69
|
-
/* Shadows */
|
|
70
|
-
--mandu-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
71
|
-
--mandu-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
|
|
72
|
-
--mandu-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
|
73
|
-
|
|
74
|
-
/* Transitions */
|
|
75
|
-
--mandu-transition-fast: 150ms;
|
|
76
|
-
--mandu-transition-normal: 200ms;
|
|
77
|
-
--mandu-transition-slow: 300ms;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.dark {
|
|
81
|
-
--mandu-background: 222.2 84% 4.9%;
|
|
82
|
-
--mandu-foreground: 210 40% 98%;
|
|
83
|
-
|
|
84
|
-
--mandu-card: 222.2 84% 4.9%;
|
|
85
|
-
--mandu-card-foreground: 210 40% 98%;
|
|
86
|
-
|
|
87
|
-
--mandu-primary: 217.2 91.2% 59.8%;
|
|
88
|
-
--mandu-primary-foreground: 222.2 47.4% 11.2%;
|
|
89
|
-
|
|
90
|
-
--mandu-secondary: 217.2 32.6% 17.5%;
|
|
91
|
-
--mandu-secondary-foreground: 210 40% 98%;
|
|
92
|
-
|
|
93
|
-
--mandu-muted: 217.2 32.6% 17.5%;
|
|
94
|
-
--mandu-muted-foreground: 215 20.2% 65.1%;
|
|
95
|
-
|
|
96
|
-
--mandu-accent: 217.2 32.6% 17.5%;
|
|
97
|
-
--mandu-accent-foreground: 210 40% 98%;
|
|
98
|
-
|
|
99
|
-
--mandu-destructive: 0 62.8% 30.6%;
|
|
100
|
-
--mandu-destructive-foreground: 210 40% 98%;
|
|
101
|
-
|
|
102
|
-
--mandu-border: 217.2 32.6% 17.5%;
|
|
103
|
-
--mandu-input: 217.2 32.6% 17.5%;
|
|
104
|
-
--mandu-ring: 224.3 76.3% 48%;
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
## Tailwind 토큰 연결
|
|
110
|
-
|
|
111
|
-
```typescript
|
|
112
|
-
// tailwind.config.ts
|
|
113
|
-
export default {
|
|
114
|
-
theme: {
|
|
115
|
-
extend: {
|
|
116
|
-
colors: {
|
|
117
|
-
background: "hsl(var(--mandu-background))",
|
|
118
|
-
foreground: "hsl(var(--mandu-foreground))",
|
|
119
|
-
card: {
|
|
120
|
-
DEFAULT: "hsl(var(--mandu-card))",
|
|
121
|
-
foreground: "hsl(var(--mandu-card-foreground))",
|
|
122
|
-
},
|
|
123
|
-
primary: {
|
|
124
|
-
DEFAULT: "hsl(var(--mandu-primary))",
|
|
125
|
-
foreground: "hsl(var(--mandu-primary-foreground))",
|
|
126
|
-
},
|
|
127
|
-
secondary: {
|
|
128
|
-
DEFAULT: "hsl(var(--mandu-secondary))",
|
|
129
|
-
foreground: "hsl(var(--mandu-secondary-foreground))",
|
|
130
|
-
},
|
|
131
|
-
muted: {
|
|
132
|
-
DEFAULT: "hsl(var(--mandu-muted))",
|
|
133
|
-
foreground: "hsl(var(--mandu-muted-foreground))",
|
|
134
|
-
},
|
|
135
|
-
accent: {
|
|
136
|
-
DEFAULT: "hsl(var(--mandu-accent))",
|
|
137
|
-
foreground: "hsl(var(--mandu-accent-foreground))",
|
|
138
|
-
},
|
|
139
|
-
destructive: {
|
|
140
|
-
DEFAULT: "hsl(var(--mandu-destructive))",
|
|
141
|
-
foreground: "hsl(var(--mandu-destructive-foreground))",
|
|
142
|
-
},
|
|
143
|
-
border: "hsl(var(--mandu-border))",
|
|
144
|
-
input: "hsl(var(--mandu-input))",
|
|
145
|
-
ring: "hsl(var(--mandu-ring))",
|
|
146
|
-
},
|
|
147
|
-
borderRadius: {
|
|
148
|
-
sm: "var(--mandu-radius-sm)",
|
|
149
|
-
md: "var(--mandu-radius-md)",
|
|
150
|
-
lg: "var(--mandu-radius-lg)",
|
|
151
|
-
},
|
|
152
|
-
fontFamily: {
|
|
153
|
-
sans: ["var(--mandu-font-sans)"],
|
|
154
|
-
mono: ["var(--mandu-font-mono)"],
|
|
155
|
-
},
|
|
156
|
-
},
|
|
157
|
-
},
|
|
158
|
-
};
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
## 토큰 사용 예시
|
|
162
|
-
|
|
163
|
-
```tsx
|
|
164
|
-
// 자동으로 다크모드 지원
|
|
165
|
-
<div className="bg-background text-foreground">
|
|
166
|
-
<button className="bg-primary text-primary-foreground rounded-md">
|
|
167
|
-
Button
|
|
168
|
-
</button>
|
|
169
|
-
</div>
|
|
170
|
-
|
|
171
|
-
// HSL로 opacity 조절 가능
|
|
172
|
-
<div className="bg-primary/50">
|
|
173
|
-
50% opacity primary
|
|
174
|
-
</div>
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
## 토큰 타입 정의 (TypeScript)
|
|
178
|
-
|
|
179
|
-
```typescript
|
|
180
|
-
// types/tokens.ts
|
|
181
|
-
export interface DesignTokens {
|
|
182
|
-
colors: {
|
|
183
|
-
background: string;
|
|
184
|
-
foreground: string;
|
|
185
|
-
primary: string;
|
|
186
|
-
secondary: string;
|
|
187
|
-
// ...
|
|
188
|
-
};
|
|
189
|
-
spacing: {
|
|
190
|
-
xs: string;
|
|
191
|
-
sm: string;
|
|
192
|
-
md: string;
|
|
193
|
-
lg: string;
|
|
194
|
-
xl: string;
|
|
195
|
-
};
|
|
196
|
-
radii: {
|
|
197
|
-
sm: string;
|
|
198
|
-
md: string;
|
|
199
|
-
lg: string;
|
|
200
|
-
full: string;
|
|
201
|
-
};
|
|
202
|
-
}
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
Reference: [Design Tokens W3C](https://www.w3.org/community/design-tokens/)
|
|
1
|
+
---
|
|
2
|
+
title: Design Tokens
|
|
3
|
+
impact: HIGH
|
|
4
|
+
impactDescription: Consistent design system foundation
|
|
5
|
+
tags: styling, tokens, design-system, variables
|
|
6
|
+
---
|
|
7
|
+
|
|
8
|
+
## Design Tokens
|
|
9
|
+
|
|
10
|
+
**Impact: HIGH (Consistent design system foundation)**
|
|
11
|
+
|
|
12
|
+
디자인 토큰을 사용하여 일관된 스타일 시스템을 구축하세요.
|
|
13
|
+
|
|
14
|
+
## CSS Variables 기반 토큰
|
|
15
|
+
|
|
16
|
+
```css
|
|
17
|
+
/* app/globals.css */
|
|
18
|
+
@layer base {
|
|
19
|
+
:root {
|
|
20
|
+
/* Colors - HSL format for opacity support */
|
|
21
|
+
--mandu-background: 0 0% 100%;
|
|
22
|
+
--mandu-foreground: 222.2 84% 4.9%;
|
|
23
|
+
|
|
24
|
+
--mandu-card: 0 0% 100%;
|
|
25
|
+
--mandu-card-foreground: 222.2 84% 4.9%;
|
|
26
|
+
|
|
27
|
+
--mandu-primary: 221.2 83.2% 53.3%;
|
|
28
|
+
--mandu-primary-foreground: 210 40% 98%;
|
|
29
|
+
|
|
30
|
+
--mandu-secondary: 210 40% 96.1%;
|
|
31
|
+
--mandu-secondary-foreground: 222.2 47.4% 11.2%;
|
|
32
|
+
|
|
33
|
+
--mandu-muted: 210 40% 96.1%;
|
|
34
|
+
--mandu-muted-foreground: 215.4 16.3% 46.9%;
|
|
35
|
+
|
|
36
|
+
--mandu-accent: 210 40% 96.1%;
|
|
37
|
+
--mandu-accent-foreground: 222.2 47.4% 11.2%;
|
|
38
|
+
|
|
39
|
+
--mandu-destructive: 0 84.2% 60.2%;
|
|
40
|
+
--mandu-destructive-foreground: 210 40% 98%;
|
|
41
|
+
|
|
42
|
+
--mandu-border: 214.3 31.8% 91.4%;
|
|
43
|
+
--mandu-input: 214.3 31.8% 91.4%;
|
|
44
|
+
--mandu-ring: 221.2 83.2% 53.3%;
|
|
45
|
+
|
|
46
|
+
/* Spacing */
|
|
47
|
+
--mandu-spacing-xs: 0.25rem;
|
|
48
|
+
--mandu-spacing-sm: 0.5rem;
|
|
49
|
+
--mandu-spacing-md: 1rem;
|
|
50
|
+
--mandu-spacing-lg: 1.5rem;
|
|
51
|
+
--mandu-spacing-xl: 2rem;
|
|
52
|
+
|
|
53
|
+
/* Typography */
|
|
54
|
+
--mandu-font-sans: ui-sans-serif, system-ui, sans-serif;
|
|
55
|
+
--mandu-font-mono: ui-monospace, monospace;
|
|
56
|
+
|
|
57
|
+
--mandu-text-xs: 0.75rem;
|
|
58
|
+
--mandu-text-sm: 0.875rem;
|
|
59
|
+
--mandu-text-base: 1rem;
|
|
60
|
+
--mandu-text-lg: 1.125rem;
|
|
61
|
+
--mandu-text-xl: 1.25rem;
|
|
62
|
+
|
|
63
|
+
/* Borders */
|
|
64
|
+
--mandu-radius-sm: 0.25rem;
|
|
65
|
+
--mandu-radius-md: 0.5rem;
|
|
66
|
+
--mandu-radius-lg: 0.75rem;
|
|
67
|
+
--mandu-radius-full: 9999px;
|
|
68
|
+
|
|
69
|
+
/* Shadows */
|
|
70
|
+
--mandu-shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
|
|
71
|
+
--mandu-shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
|
|
72
|
+
--mandu-shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);
|
|
73
|
+
|
|
74
|
+
/* Transitions */
|
|
75
|
+
--mandu-transition-fast: 150ms;
|
|
76
|
+
--mandu-transition-normal: 200ms;
|
|
77
|
+
--mandu-transition-slow: 300ms;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.dark {
|
|
81
|
+
--mandu-background: 222.2 84% 4.9%;
|
|
82
|
+
--mandu-foreground: 210 40% 98%;
|
|
83
|
+
|
|
84
|
+
--mandu-card: 222.2 84% 4.9%;
|
|
85
|
+
--mandu-card-foreground: 210 40% 98%;
|
|
86
|
+
|
|
87
|
+
--mandu-primary: 217.2 91.2% 59.8%;
|
|
88
|
+
--mandu-primary-foreground: 222.2 47.4% 11.2%;
|
|
89
|
+
|
|
90
|
+
--mandu-secondary: 217.2 32.6% 17.5%;
|
|
91
|
+
--mandu-secondary-foreground: 210 40% 98%;
|
|
92
|
+
|
|
93
|
+
--mandu-muted: 217.2 32.6% 17.5%;
|
|
94
|
+
--mandu-muted-foreground: 215 20.2% 65.1%;
|
|
95
|
+
|
|
96
|
+
--mandu-accent: 217.2 32.6% 17.5%;
|
|
97
|
+
--mandu-accent-foreground: 210 40% 98%;
|
|
98
|
+
|
|
99
|
+
--mandu-destructive: 0 62.8% 30.6%;
|
|
100
|
+
--mandu-destructive-foreground: 210 40% 98%;
|
|
101
|
+
|
|
102
|
+
--mandu-border: 217.2 32.6% 17.5%;
|
|
103
|
+
--mandu-input: 217.2 32.6% 17.5%;
|
|
104
|
+
--mandu-ring: 224.3 76.3% 48%;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
## Tailwind 토큰 연결
|
|
110
|
+
|
|
111
|
+
```typescript
|
|
112
|
+
// tailwind.config.ts
|
|
113
|
+
export default {
|
|
114
|
+
theme: {
|
|
115
|
+
extend: {
|
|
116
|
+
colors: {
|
|
117
|
+
background: "hsl(var(--mandu-background))",
|
|
118
|
+
foreground: "hsl(var(--mandu-foreground))",
|
|
119
|
+
card: {
|
|
120
|
+
DEFAULT: "hsl(var(--mandu-card))",
|
|
121
|
+
foreground: "hsl(var(--mandu-card-foreground))",
|
|
122
|
+
},
|
|
123
|
+
primary: {
|
|
124
|
+
DEFAULT: "hsl(var(--mandu-primary))",
|
|
125
|
+
foreground: "hsl(var(--mandu-primary-foreground))",
|
|
126
|
+
},
|
|
127
|
+
secondary: {
|
|
128
|
+
DEFAULT: "hsl(var(--mandu-secondary))",
|
|
129
|
+
foreground: "hsl(var(--mandu-secondary-foreground))",
|
|
130
|
+
},
|
|
131
|
+
muted: {
|
|
132
|
+
DEFAULT: "hsl(var(--mandu-muted))",
|
|
133
|
+
foreground: "hsl(var(--mandu-muted-foreground))",
|
|
134
|
+
},
|
|
135
|
+
accent: {
|
|
136
|
+
DEFAULT: "hsl(var(--mandu-accent))",
|
|
137
|
+
foreground: "hsl(var(--mandu-accent-foreground))",
|
|
138
|
+
},
|
|
139
|
+
destructive: {
|
|
140
|
+
DEFAULT: "hsl(var(--mandu-destructive))",
|
|
141
|
+
foreground: "hsl(var(--mandu-destructive-foreground))",
|
|
142
|
+
},
|
|
143
|
+
border: "hsl(var(--mandu-border))",
|
|
144
|
+
input: "hsl(var(--mandu-input))",
|
|
145
|
+
ring: "hsl(var(--mandu-ring))",
|
|
146
|
+
},
|
|
147
|
+
borderRadius: {
|
|
148
|
+
sm: "var(--mandu-radius-sm)",
|
|
149
|
+
md: "var(--mandu-radius-md)",
|
|
150
|
+
lg: "var(--mandu-radius-lg)",
|
|
151
|
+
},
|
|
152
|
+
fontFamily: {
|
|
153
|
+
sans: ["var(--mandu-font-sans)"],
|
|
154
|
+
mono: ["var(--mandu-font-mono)"],
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## 토큰 사용 예시
|
|
162
|
+
|
|
163
|
+
```tsx
|
|
164
|
+
// 자동으로 다크모드 지원
|
|
165
|
+
<div className="bg-background text-foreground">
|
|
166
|
+
<button className="bg-primary text-primary-foreground rounded-md">
|
|
167
|
+
Button
|
|
168
|
+
</button>
|
|
169
|
+
</div>
|
|
170
|
+
|
|
171
|
+
// HSL로 opacity 조절 가능
|
|
172
|
+
<div className="bg-primary/50">
|
|
173
|
+
50% opacity primary
|
|
174
|
+
</div>
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
## 토큰 타입 정의 (TypeScript)
|
|
178
|
+
|
|
179
|
+
```typescript
|
|
180
|
+
// types/tokens.ts
|
|
181
|
+
export interface DesignTokens {
|
|
182
|
+
colors: {
|
|
183
|
+
background: string;
|
|
184
|
+
foreground: string;
|
|
185
|
+
primary: string;
|
|
186
|
+
secondary: string;
|
|
187
|
+
// ...
|
|
188
|
+
};
|
|
189
|
+
spacing: {
|
|
190
|
+
xs: string;
|
|
191
|
+
sm: string;
|
|
192
|
+
md: string;
|
|
193
|
+
lg: string;
|
|
194
|
+
xl: string;
|
|
195
|
+
};
|
|
196
|
+
radii: {
|
|
197
|
+
sm: string;
|
|
198
|
+
md: string;
|
|
199
|
+
lg: string;
|
|
200
|
+
full: string;
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Reference: [Design Tokens W3C](https://www.w3.org/community/design-tokens/)
|