DOL Design System - Typography
Scope: Typography deep-dive - font family, text scale, density taxonomy, text group matrix. For philosophy: see DIRECTION.md §6 Typography philosophy. For code (Tailwind classes): see
../ui-style-guide/CORE.md§3 Typography.
1. Purpose
Section titled “1. Purpose”Tài liệu này tập trung vào:
- font family
- font size
- line-height density (
compact,standard,extended,fit) - cách chọn style theo độ dài nội dung (1 dòng, 2 dòng, nhiều dòng)
Triết lý chung, core pillars, và anti-patterns cross-topic → xem DIRECTION.md.
2. Nền tảng typography
Section titled “2. Nền tảng typography”2.1 Font family
Section titled “2.1 Font family”- Heading/Display:
Plus Jakarta Sans(--font-family-heading) - Body/Label:
Inter(--font-family-body) - Quote:
Noto Serif(--font-family-quote)
2.2 Font weight
Section titled “2.2 Font weight”regular: 400medium: 500semibold: 600bold: 700black: 900
2.3 Text scale cơ bản
Section titled “2.3 Text scale cơ bản”xs: 10pxsm: 12pxbase: 14pxmd: 16px (mobile bodymdmap sangmd-sub= 15px)lg: 18pxxl: 20px2xl: 24px3xl: 28px4xl: 32px5xl: 40px6xl: 44px7xl: 48px8xl: 56px9xl: 60px10xl: 64px
3. Cách dùng theo nhóm text
Section titled “3. Cách dùng theo nhóm text”3.0 Fit policy (quy tắc cứng)
Section titled “3.0 Fit policy (quy tắc cứng)”fitchỉ dùng cho mục đích trang trí.- Chỉ dùng khi text đúng 1 dòng duy nhất.
- Không dùng
fitcho nội dung cần đọc, kể cả heading nội dung.
3.1 Display (hero, key number, title impact cao)
Section titled “3.1 Display (hero, key number, title impact cao)”Current styles:
display/8xl/bold-standarddisplay/8xl/bold-fitdisplay/9xl/bold-standarddisplay/9xl/bold-fit
Quy tắc:
- Mặc định dùng
standard. fitchỉ dùng khi là text trang trí, đúng 1 dòng.- Không dùng
fitcho đoạn text dài hoặc cần dễ đọc.
3.2 Heading (title section, title card, title page)
Section titled “3.2 Heading (title section, title card, title page)”Pattern:
heading/{size}/{weight-density}
Current matrix:
base,md,lg: chỉ cóstandard(medium/semibold/bold)xl:standard,fit, và 1 style đặc biệtheading/xl/medium-compact2xl->7xl:standard+fit(medium/semibold/bold)
Quy tắc:
- Mặc định dùng
standard. - Không dùng
fitcho heading nội dung. - Nếu dùng
fitthì phải là text trang trí, 1 dòng duy nhất. heading/xl/medium-compactchỉ dùng khi layout rất chật và text tối đa 1-2 dòng.
3.3 Body (mô tả, paragraph, nội dung chính)
Section titled “3.3 Body (mô tả, paragraph, nội dung chính)”Pattern:
body/{size}/{weight-density}
Current matrix:
xs,sm:compact,standardbase,md:compact,standard,extendedlg,xl,2xl:standard
Default để team dùng nhanh:
- Body thường:
body/base/regular-standard(14/20) - Body ngắn trong UI chật:
body/base/regular-compact(14/16) - Body dài để đọc:
body/base/regular-extended(14/24)
Quy tắc:
standard= default cho đa số body text.compact= text ngắn, mật độ cao, không ưu tiên đọc dài.extended= text dài nhiều dòng, ưu tiên đọc, thoáng hơn.
3.4 Label (button label, tag, overline)
Section titled “3.4 Label (button label, tag, overline)”Pattern:
label/{size}/{weight-uppercase}
Current styles:
label/xs|sm|base/{semibold|bold}-uppercase
Quy tắc:
- Luôn uppercase theo token.
- Không dùng cho paragraph.
- Hạn chế 1 dòng; nếu cần 2 dòng thì cần xem lại content.
3.5 Quote (testimonial, trích dẫn)
Section titled “3.5 Quote (testimonial, trích dẫn)”Pattern:
quote/{size}/{weight-standard}
Current styles:
quote/lg|xl|2xl/{regular|semibold}-standard
Quy tắc:
- Dùng
Noto Serif(qua token quote). - Giữ
standardđể đảm bảo readability.
4. Rule line-height theo độ dài nội dung
Section titled “4. Rule line-height theo độ dài nội dung”Bảng quyết định nhanh:
| Tình huống | Density nên dùng | Ghi chú |
|---|---|---|
| Text trang trí 1 dòng duy nhất | fit | Chỉ dùng cho mục đích trang trí |
| Heading 1-2 dòng thông thường | standard | Lựa chọn mặc định |
| Heading rất chật layout (chỉ 1 style cho phép) | compact | Dùng heading/xl/medium-compact |
| Body 1-2 dòng trong UI dense | compact | VD: table, chips, metadata ngắn |
| Body 2-4 dòng thông thường | standard | Lựa chọn mặc định |
| Body 3+ dòng, ưu tiên đọc | extended | VD: helper text dài, article snippet |
| Label | uppercase set riêng | Không thay density ngoài token |
| Quote | standard | Ổn định để đọc |
5. Rule theo context sử dụng
Section titled “5. Rule theo context sử dụng”- Button text: ưu tiên
label/*hoặcbody/sm|base/*-standardtùy component. - Form field label: ưu tiên
label/sm/semibold-uppercasehoặc style label trong component spec. - Helper/error text:
body/xs/*-standardhoặcbody/sm/*-standard; tránhfit. - Card description:
body/base/regular-standard; nếu copy dài thìextended. - Hero title: mặc định dùng
display/*/bold-standard; chỉ dùngfitnếu là text trang trí và đúng 1 dòng.
6. Responsive rule
Section titled “6. Responsive rule”- Luôn dùng semantic token, không hardcode px theo breakpoint.
- Hệ thống đã map Desktop/Tablet/Mobile sẵn:
- Typography semantic:
Desktop,Tablet,Mobile - Mobile có downscale một số cấp (vd
body/md->15px)
- Typography semantic:
- Giữ nguyên style key xuyên suốt các breakpoint; để token layer xử lý scale.
7. Do and Dont
Section titled “7. Do and Dont”Do:
- Dùng
standardlàm default trừ khi có lý do rõ ràng. - Chọn style theo vai trò text trước (display/heading/body/label/quote).
- Dùng token naming pattern thay vì set tay
font-size/line-height.
Dont:
- Không dùng
fitcho text nội dung (heading/body/label/quote). fitchỉ dùng cho text trang trí, 1 dòng duy nhất.- Không dùng label uppercase cho body copy.
- Không mix font heading vào body text.
- Không set line-height tùy ý ngoài token khi không có exception được phê duyệt.
8. Checklist trước handoff
Section titled “8. Checklist trước handoff”- Đã dùng đúng group text (display/heading/body/label/quote)?
- Density có đúng với độ dài content?
- Body copy >= 3 dòng đã xem xét
extendedchưa? - Mobile có giữ semantic token (không hardcode)?
- Có token nào bị phá vỡ naming/contract không?
Navigation
Section titled “Navigation”- Hub: README.md
- Direction & philosophy: DIRECTION.md
- Related topic files: color.md, spacing.md
- Code reference:
../ui-style-guide/CORE.md§3 Typography (Tailwind classes, typography-by-context table)