Casso Brand Kit
Tải trọn bộ logo
Mục lục

Foundations

Casso Design System

Trang này là bản bàn giao cho FE. Component viết bằng HTML và CSS thuần, không cần React, Vue hay Tailwind, nên dùng được với mọi stack.

Color scheme
Brand
Density
Radius
Emphasis
Type scale

Generated Styles, Hand-Written Behavior

Phần hình của component không gõ tay. CSS của từng component sinh ra từ contract đo trong file Figma.

Khi Figma đổi, chỉ cần sinh lại contract là CSS đổi theo. Nhờ vậy, component ở đây không lệch khỏi file thiết kế.

Phần hành vi viết tay trong file <name>.js, gồm dựng DOM, thuộc tính a11y (accessibility) và gắn sự kiện.

Components in This Version

FolderFigma ContractVariantProperties
buttonButton/Main200Size × Level × State
button-flatButton/Flat50Size × Level × State
button-icon-mainButton/Icon-Main240Size × Level × State
button-icon-flatButton/Icon-Flat125Size × Level × State
inputInput/Text-Field36Size × State
top-navigation-masterTop-Navigation/Master/Medium4Size × Inverse
top-navigationTop-Navigation/Sub/Medium12Size × Type × Inverse
checkboxCheckbox/Mark45Size × Type × State × Select
radioRadio-Button/Radio-Mark30Size × State × Select
chipChip/Normal108Size × Level × Leading × State × Select
date-picker.Primitives/Date-Picker/Day-Cell42State × Selection

Not Yet Included

ItemWhy
Toggle · Alert Banner · Inline MessageĐang hoàn thiện, chưa có trong bản này
IconĐã có 1.826 icon 24×24 đơn sắc, dùng currentColor. Xem Foundations / Iconography
Component nhiều logicDate Picker ở đây chỉ là Day Cell (primitive). Phần hành vi do ứng dụng tự làm

Next Version

  • 01Table: đang phát triển, chưa có mẫu nào đạt. Trong lúc chờ, anh em cứ vibe trước theo luật ở Components / Extending.

Modes

Design system không đọc prefers-color-scheme mà đọc 6 Mode, đặt bằng thuộc tính trên thẻ <html>. Mode bar ở đầu trang có đủ 6 Mode, đổi Mode nào thì mọi mẫu trên trang đổi theo.

AttributeModeValues
data-themeColor schemelight · dark
data-brandBrandcasso · cas-id
data-densityDensitycomfortable · compact
data-radiusRadiusstandard · rounded
data-emphasisEmphasisbrand · neutral
data-type-scaleType scalebase-14 · base-16

Color Token Tiers

Token màu tách thành bốn file theo đúng bốn tier trong Figma, để mỗi file đủ ngắn mà đọc được.

FileTier
src/styles/color/1-global.cssTier 1, thang màu gốc. Token riêng của hệ thống, dùng thẳng là mất theming.
src/styles/color/2-base.cssTier 2, bảng màu của brand. Mode data-brand (casso | cas-id).
src/styles/color/3-semantic.cssTier 3, màu theo vai trò. Mode data-theme (light | dark). Tier nên dùng.
src/styles/color/4-component.cssTier 4, màu riêng của component. Mode data-emphasis (brand | neutral).
src/styles/dimension.cssKích thước: spacing · corner-radius · size component · lưới breakpoint.
src/styles/type.cssBiến chữ: font · cỡ · line-height · letter-spacing · độ đậm.