Repository navigation
Theming and Tokens
github-actions[bot] edited this page Nov 3, 2026
·
2 revisions
Tiếng Việt: Theming-and-Tokens-vi.
<YugenProvider applyToDocument theme="dark" brand="sakura" dir="rtl">…</YugenProvider>| Prop | Values |
|---|---|
theme |
light · dark · high-contrast
|
brand |
sakura (default) · web (Fluent Blue) · teams · a custom brand |
dir |
ltr · rtl
|
Providers can be nested (for example a dark region inside a light page). Portals (Dialog, Menu…) follow the nearest provider
through usePortalThemeProps().
- Open the Theme Designer and pick the key color (step 80).
- Check the contrast cells (≥ 4.5:1), adjust vibrancy / hue torsion if needed.
-
Export:
-
CSS → paste the
[data-brand="my-brand"] { --brand-10 … --brand-160 }block into your CSS. - W3C Design Tokens (DTCG) → Style Dictionary 4, Figma Variables, Penpot.
-
Tokens Studio → the Tokens Studio for Figma plugin (
global/light/darksets).
-
CSS → paste the
- Set
brand="my-brand"onYugenProvider.
In code: generateBrandRamp("#0F6CBD"), rampToCss(), rampToDesignTokens(), rampToTokensStudio(), all exported from yugen-ui.
.my-panel {
background: var(--colorNeutralBackground1);
color: var(--colorNeutralForeground2);
padding: var(--spacingL);
border-radius: var(--borderRadiusMedium);
box-shadow: var(--shadow4);
}Only need the CSS variables? import "yugen-ui/tokens.css".
- Neutral colors for surfaces / text; brand only for CTAs, selected states, focus, links; semantic colors only for status.
- Don't cover large areas with brand color; gradients only for hero sections / illustrations, never on controls.
- Text ≥ 4.5:1, UI elements ≥ 3:1; never use color as the only signal.
Full rules: Design.md §4 and the Color page.
Yugen UI © trandat1114 · MIT · Inspired by Microsoft Fluent 2, not a Microsoft product · Edit the wiki through the wiki/ folder · Lấy cảm hứng từ Microsoft Fluent 2, không phải sản phẩm của Microsoft · Sửa wiki qua thư mục wiki/
Use
Develop
Project
Tiếng Việt
- Trang chủ
- Bắt đầu
- Theme & token
- Câu hỏi thường gặp
- Kiến trúc
- Viết component
- Kiểm thử & CI
- Viết nội dung
- Nhánh & kênh phát hành
- Phát hành
- Cộng đồng & phân loại
- Sổ tay vận hành
Links