foundations

foundations là các token và quy ước cơ bản — nền tảng để xây dựng mọi thành phần giao diện. mỗi giá trị được định nghĩa một lần trong src/tokens/tokens.css và dùng xuyên suốt trong astro, storybook, và figma.

kiến trúc token 3 lớp

học từ SAP và Calcite — tách biệt reference, semantic, và component tokens để kiểm soát chính xác phạm vi thay đổi khi chuyển brand hoặc theme.

lớp 1

reference

--ref-*

raw values cố định. không bao giờ thay đổi. ~120 tokens.

lớp 2

semantic

--color-* --text-* --surface-* --border-*

theme-aware. brand + dark mode override lớp này. ~70 tokens.

lớp 3

component

--btn-* --card-* --input-* --table-*

luôn trỏ đến lớp 2. tự động kế thừa theme. ~50 tokens.

--ref-blue-600 --color-brand-600 --btn-primary-bg

nội dung foundations

single source of truth

tất cả token được định nghĩa trong src/tokens/tokens.css. astro import css, storybook import css + js. figma mirror từ code. một nguồn, nhiều nơi dùng.