본문으로 건너뛰기

Token Guide ​

전체 값은 Token Reference에 있습니다. 이 문서는 토큰을 쓰고 고칠 때 지켜야 할 규칙을 설명합니다.

계층 ​

계층예용도
Primitivecolor-slate-200, color-primary-600팔레트. 화면과 컴포넌트에서 직접 쓰지 않습니다
Semanticcolor-border-default, color-action-primary역할 기준 이름. 화면과 컴포넌트는 이 계층을 씁니다
컴포넌트table-row-hover-bg특정 컴포넌트 전용 별칭

Semantic 토큰은 Primitive 토큰을 참조합니다. 브랜드 컬러가 바뀌면 Primitive 토큰만 교체합니다.

Tailwind 유틸리티 ​

토큰유틸리티 예
color-*bg-action-primary, text-text-secondary, border-border-default
text-<단계>-sizetext-sm, text-2xl
control-height-*, icon-size-*, row-*h-control-md, w-icon-md, h-row-compact
elevation-*, easing-standardshadow-elevation-2, ease-standard
space-*, radius-*p-4, gap-2, rounded-md

유틸리티가 없는 토큰은 변수 단축 표기로 씁니다. 예: duration-(--duration-fast), z-(--z-modal).

다크 테마 ​

<html> 에 data-theme="dark" 를 붙이면 다크 테마로 바뀝니다. Semantic 토큰만 쓴 화면은 따로 고치지 않아도 되고, Primitive 토큰(bg-slate-100 등)을 직접 쓴 곳은 바뀌지 않습니다.

토큰 추가·변경 ​

  1. 기존 토큰으로 해결되는지 Token Reference에서 먼저 확인합니다.
  2. tokens/*.json 을 수정합니다. 새 색은 Primitive 토큰을 먼저 추가하고 Semantic 토큰이 그것을 참조하게 합니다.
  3. npm run build:tokens 를 실행해 CSS, Tailwind 설정, Figma 데이터, Token Reference를 다시 만들고 원본 JSON과 함께 커밋합니다.

생성된 파일은 직접 고치지 않습니다. JSON 작성 형식은 저장소의 tokens/README.md 를 참고합니다.