Skip to content

Design tokens — Soft Periwinkle ​

Chỉ light baseline (không dark mode). Hướng: pastel primary Soft Periwinkle với dark ink trên fill pastel (AQ-001 / ADR-004).

Quy tắc ​

  • Fill primary / accent dùng ink *-foreground tối — không mặc định chữ pastel trên pastel.
  • Soft surface: muted, card, secondary.
  • Touch: --size-touch-min: 44px (FR-008).
  • Focus: --color-ring / --focus-ring-* phải còn nhìn thấy trên pastel UI.
  • Focus policy (ship trong focus-chrome.css): form field dùng :focus (tap WebView vào field); button / tab / disclosure chỉ :focus-visible (không sticky tap ring trên Accordion header, v.v.).
  • Elevation: shadow soft có tint periwinkle; card ưu tiên shadow không border mặc định.
  • Overlay scrim dùng --color-overlay (Tailwind bg-overlay) — không dùng raw black/80.

CSS entrypoint (@minap/ui) ​

ImportVai trò
@minap/ui/styles.cssSoft Periwinkle :root mặc định + focus chrome + native-temporal
@minap/ui/themes.cssMulti-theme runtime (data-minap-theme) + native-temporal
@minap/ui/soft-*.cssĐổi single-theme tùy chọn (cũng gồm focus chrome + native-temporal)

Ưu tiên @import "@minap/ui/styles.css" trong app. Map utility qua @minap/ui/tailwind-preset (minapUiPreset).

Giá trị cốt lõi ​

TokenValue
--color-backgroundhsl(210 40% 99%)
--color-foregroundhsl(229 32% 16%)
--color-primaryhsl(234 48% 78%)
--color-primary-foregroundhsl(234 40% 18%)
--color-primary-softhsl(234 48% 90%)
--color-secondaryhsl(230 35% 94%)
--color-mutedhsl(226 30% 95%)
--color-accenthsl(234 40% 92%)
--color-destructivehsl(0 72% 51%)
--color-successhsl(142 55% 36%)
--color-warninghsl(38 92% 42%)
--color-infohsl(210 70% 45%)
--color-borderhsl(228 22% 90%)
--color-inputhsl(228 22% 88%)
--color-ringhsl(234 45% 45%)
--size-touch-min44px

Radius / elevation (Mobile-First) ​

TokenValueDùng cho
--radius-sm0.375remChip chặt
--radius-md0.75remButton / input (~12px) → Tailwind rounded-md
--radius-lg1remPanel lớn hơn
--radius-xl / --radius-2xl1.25rem / 1.5remSurface lớn (rounded-xl / rounded-2xl)
--radius-sheetvar(--radius-2xl)Góc Drawer / Sheet → rounded-t-sheet / rounded-b-sheet
--shadow-sm / --shadow / --shadow-md / --shadow-lgSoft periwinkle-tintedTailwind shadow-sm … shadow-lg
--color-overlayhsl(229 32% 16% / 0.45)Scrim Sheet / Drawer → bg-overlay
--color-card-borderhsl(228 22% 94%)Hairline tùy chọn → border-card-border

Primary vẫn Soft Periwinkle pastel với dark ink (không violet bão hòa + chữ trắng).

Default component tiêu thụ các token này ​

ControlChrome mặc định (kit)
Cardrounded-xl shadow — không border; thêm border border-card-border nếu cần
DrawerScrim bg-overlay; content rounded-t-sheet shadow-lg + drag handle
SheetScrim bg-overlay; bottom/top dùng rounded-*-sheet
Badgevariant="soft" (fill pastel *-soft) mặc định
Buttonrounded-md, h-touch, solid primary = pastel + dark ink
DatePicker / TimeField / DateTimePickerNative path: ẩn chrome calendar/clock UA qua native-temporal.css

Prop color dùng chung (industry): primary | success | warning | destructive | info. Bỏ color → primary Soft Periwinkle (không có giá trị color="default"). Button/Badge còn variant: Button solid | outline | ghost | link | secondary; Badge soft (mặc định) | solid | outline | secondary. Alert / Toast / Badge soft dùng pastel *-soft. Đồng nghĩa: danger ≡ destructive.

Theme thay thế (tùy chọn) ​

Mặc định vẫn Soft Periwinkle (styles.css). Đổi (hoặc override :root) bằng:

ImportTheme
@minap/ui/soft-periwinkle-light.cssSoft Periwinkle Light
@minap/ui/soft-sage-mist.cssSoft Sage Mist
@minap/ui/soft-enterprise.cssSoft Enterprise

Không import theme thay thế và styles.css trừ khi cố ý để theme thay thế override mặc định (load theme thay thế sau cùng).

So sánh realtime (playground): import @minap/ui/themes.css, set document.documentElement.dataset.minapTheme, mở /samples/work-board.

Showcase ​

Route playground /tokens — review ~375px width. Theme lab: /samples/work-board.

MINAP UI · SoT docs/ (VI + thuật ngữ EN)