spacing

spacing, border radius, shadows, opacity, z-index — tất cả environment tokens nhất quán bất kể brand.

spacing scale

dựa trên 4px grid. mọi gap, margin, và padding đều từ scale này. 7 cấp từ --space-xs (4px) đến --space-3xl (64px).

xs · 4px
4px
sm · 8px
8px
md · 16px
16px
lg · 24px
24px
xl · 32px
32px
2xl · 48px
48px
3xl · 64px
64px

border radius

sáu cấp từ gần vuông đến hình viên hoàn toàn. radius nhất quán tạo phân cấp thị giác nhất quán.

none 2px vuông
sm 4px mềm
md 8px bo tròn
lg 12px tròn hơn
xl 16px siêu tròn
full 9999px hình viên

shadows / elevation

bốn cấp elevation tạo chiều sâu. dùng elevation tối thiểu cần thiết — đừng nâng mọi thứ lên.

sm
card resting state, độ nổi thấp
0 1px 2px 0 rgba(2, 6, 23, 0.05)
md
dropdown, tooltip, popover
0 4px 6px -1px rgba(2, 6, 23, 0.1)
lg
modal, dialog, sidebar
0 10px 15px -3px rgba(2, 6, 23, 0.1)
xl
drawer, full-screen overlay
0 20px 25px -5px rgba(2, 6, 23, 0.15)

opacity

bốn opacity tokens cho interactive và overlay states. không bao giờ dùng raw opacity values.

disabled 0.4 buttons, inputs, controls bị vô hiệu
overlay 0.5 modal backdrop scrim
hover 0.8 giảm độ mờ khi hover
pressed 0.9 giảm độ mờ khi active/pressed

size tokens

kích thước component — icon boxes, input heights, button heights. dùng --size-* tokens thay vì hardcode px.

tokengiá trịdùng cho
--size-icon-sm16pxicon nhỏ trong button, badge
--size-icon-md20pxicon mặc định
--size-icon-lg24pxicon lớn, navigation
--size-icon-xl32pxicon hero, feature
--size-input-sm32pxinput nhỏ, compact form
--size-input-md40pxinput mặc định
--size-input-lg48pxinput lớn, search bar
--size-btn-sm32pxbutton nhỏ, table action
--size-btn-md40pxbutton mặc định
--size-btn-lg48pxbutton lớn, CTA

border width

độ dày viền — mặc định 1px, focus ring 2px, accent 4px.

tokengiá trịdùng cho
--border-width1pxviền mặc định — card, input, divider
--border-width-md2pxfocus ring, active indicator
--border-width-lg4pxaccent bar, brand indicator

component spacing reference

mỗi component dùng một bộ spacing token nhất quán.

componentpaddinggapheight
button--space-sm --space-lg--space-xs--size-btn-*
card--space-md --space-lg
input--space-sm --space-md--size-input-*
badge--space-xs --space-sm
modal--space-lg
table cell--space-sm --space-md
tooltip--space-xs --space-sm

z-index / stacking layers

stacking context phân lớp. mỗi layer cách nhau 100 để chừa chỗ cho sub-layers.

tooltip 600 tooltip, floating labels
toast 500 toast, snackbar notifications
modal 400 modal dialog, popover
overlay 300 backdrop, overlay scrim
sticky 200 sticky header, sticky sidebar
dropdown 100 dropdown menu, select options
base 0 nội dung trang