Design Tokens
DESIGN.md의 design tokens는 colors, typography, rounded, spacing, motion 다섯 가지 핵심 그룹 아래에 정확한 시각적 프리미티브를 정의합니다.
Colors
colors는 시맨틱 토큰 이름을 유효한 CSS 색상(#RRGGBB, #RGB, #RRGGBBAA, rgb(), oklch(), CSS 색상명, color-mix())에 매핑합니다.
colors:
primary: "#4338ca"
on-primary: "#ffffff"
background: "#ffffff"
surface: "#f6f5f4"
text: "#18181b"
text-muted: "#52525b"
border: "#e5e3df"DesignMD Pro 파서는 hex 색상(#RGB, #RGBA, #RRGGBB, #RRGGBBAA)의 WCAG 상대 휘도를 계산해 자동 전경/배경 대비 검사를 실행합니다. hex가 아닌 CSS 색상 값은 파서 경고와 함께 리터럴 문자열로 보존됩니다.
Typography
typography는 스타일 이름을 구조화된 타이포그래피 속성에 매핑합니다.
| 속성 | 타입 / 값 | 예시 |
|---|---|---|
fontFamily | 폰트 스택 또는 기본 폰트 패밀리 이름 | "Inter, sans-serif" |
fontSize | CSS 치수(px, rem, em) | 16px |
fontWeight | 숫자 굵기(100–900) | 600 |
lineHeight | 단위 없는 비율 또는 CSS 치수 | 1.5 또는 24px |
letterSpacing | CSS 치수(em, px, rem) | -0.02em |
fontFeature | CSS font-feature-settings 값 | "tnum" 1 |
fontVariation | CSS font-variation-settings 값 | "opsz" 32 |
typography:
headline-display:
fontFamily: Inter
fontSize: 40px
fontWeight: 600
lineHeight: 1.15
letterSpacing: -0.02em
body-md:
fontFamily: Inter
fontSize: 16px
fontWeight: 400
lineHeight: 1.6
code-sm:
fontFamily: JetBrains Mono
fontSize: 13px
fontWeight: 400
lineHeight: 1.5Rounded & Spacing
rounded와 spacing 모두 토큰 이름을 CSS 치수(px, em, rem)에 매핑하며, spacing은 컬럼 수나 종횡비를 위한 단위 없는 숫자도 허용합니다.
rounded:
sm: 4px
md: 8px
lg: 12px
full: 9999px
spacing:
xs: 4px
sm: 8px
md: 16px
lg: 24px
xl: 48pxMotion
motion은 용도별 트랜지션 키를 duration, delay, timingFunction에 매핑합니다.
motion:
hover-quick:
duration: 150ms
timingFunction: cubic-bezier(0.2, 0, 0, 1)
drawer-enter:
duration: 240ms
delay: 0ms
timingFunction: ease-out중첩 그룹 (테마 및 브레이크포인트)
components를 제외한 모든 토큰 카테고리는 테마와 반응형 브레이크포인트를 위한 중첩 하위 맵을 지원합니다. 색상 모드에는 light/dark, 브레이크포인트에는 sm/md/lg/xl 키를 권장합니다.
colors:
primary: "#4338ca"
background: "#ffffff"
text: "#18181b"
dark:
primary: "#818cf8"
background: "#0f172a"
text: "#f8fafc"DesignMD Pro의 코드 생성기(Tailwind v4, CSS Variables, shadcn/ui, v0 프롬프트 생성기)는 light.*를 기본 토큰으로 인식하고 dark.* 키를 .dark 선택자 블록 내부에 출력합니다.
토큰 참조 ({token})
토큰은 {colors.primary}나 {rounded.md} 같은 중괄호 점 표기 경로로 다른 토큰을 참조할 수 있습니다.
components외부에서는 참조가 원시 리프 값으로 해석되어야 합니다(예: 전체 그룹이 아닌{colors.primary}).components내부에서는 원시 값뿐 아니라{typography.body-md}같은 복합 토큰도 참조할 수 있습니다.- 참조는 더 긴 문자열 내부에 삽입할 수도 있습니다(예:
"1px solid {colors.border}"). - 순환 참조 체인(
a -> b -> a)은 검증기에서 거부됩니다(circular-ref).
다음 단계
- 컴포넌트 — 컴포넌트 정의 내부에서
{token}참조 사용하기 - 토큰 네이밍 — 자동 대비 검사 및 shadcn 매핑과 호환되는 시맨틱 네이밍 패턴
- Tailwind CSS & shadcn/ui 연동 — DesignMD Pro가 토큰을 스타일시트로 컴파일하는 방식