Key rules
- Classic: đọc
--chatty-color-*trong.Avada-Faqs_Popup; Dark chỉ bật khidata-themelà dark. - AI Mode: Dark là rule gốc trên
.chatty-ai-mode; Light ghi đè bằngdata-themelight và dùng lại palette gốc, còn Dark ánh xạ text và surface sang--vib-1và--bg-deep. - Admin: bảng body mô tả code hiện tại; Inbox mới theo Target literal Light/Dark, phase 1b chưa ship.
- Classic: shadow tier là
--chatty-shadow-1,--chatty-shadow-2,--chatty-shadow-3;--chatty-shadow-card-hoverlà token riêng ngoài ba tier này. - Giá trị trong body là code hiện tại; đề xuất sửa nằm ở Target.
On this page
Where tokens live
| Surface | File | Scope root | Theme switch |
|---|---|---|---|
| Classic | PopupBody. |
.Avada- |
Light mặc định; data- |
| AI Mode | foundation. |
.chatty- |
Dark là rule gốc; data- |
| Admin | _ |
.inbox- |
Chỉ một theme; mixin admin không có tham số theme |
How to apply
| Surface | API / class | Example |
|---|---|---|
| Classic | Sass mixin của chatty- |
@include foundations. |
| Classic | Sass mixin cho Dark | @include foundations. |
| AI Mode | Sass mixin cho Dark gốc | @include foundations. |
| AI Mode | Sass mixin cho Light | @include foundations. |
| Admin | Sass mixin của chatty- |
@include foundations. |
| Admin | CSS var kèm fallback | background: var(- |
Element map
| Element | Surface | Role/Token | Light | Dark |
|---|---|---|---|---|
| Focus ring | Classic | - |
var(-, #303030) |
var(-, #eee) |
| Field ring | Classic | - |
#c4c4c4 | #b0b0b0 |
| Form field border | Classic | - |
#8a8a8a | #b0b0b0 |
| Control accent | Classic | - |
#000000 | #ffffff |
| Error text | Classic | - |
#c63f4b | #ff9aa2 |
| Link | Classic | - |
var(-, #303030) |
var(-, #eee) |
| Base surface | AI Mode | - |
#f6f4f0 | #131215 |
| Raised surface | AI Mode | - |
#fbfaf7 | #1c1b1f |
| Glass tint regular | AI Mode | - |
rgba(252, 251, 248, 0.88) | rgba(30, 29, 34, 0.84) |
| Glass tint clear | AI Mode | - |
rgba(255, 255, 254, 0.88) | rgba(19, 18, 21, 0.84) |
| Glass edge | AI Mode | - |
rgba(20, 19, 24, 0.08) | rgba(255, 255, 255, 0.12) |
| Opaque glass fallback | AI Mode | - |
rgba(250, 249, 246, 0.98) | rgba(24, 23, 28, 0.97) |
| Danger text | AI Mode | - |
#b91c1c | #fca5a5 |
| Warning text | AI Mode | - |
#8a5200 | #f2c98a |
| Message bubble fill | Admin | - |
#f7f7f7 | No Dark skin |
| Message bubble border | Admin | - |
#d4d4d4 | No Dark skin |
| Link in bubble | Admin | - |
#005bd3 | No Dark skin |
| Inline code fill | Admin | rgba(0, 0, 0, 0.06) | rgba(0, 0, 0, 0.06) | No Dark skin |
Tokens
Classic
Variables
| Part | Token | Light | Dark |
|---|---|---|---|
| Text | - |
#303030 | #eee |
| Secondary text | - |
#616161 | #aaa |
| Disabled text | - |
#767676 | #999 |
| Link | - |
#303030 | #eee |
| Page background | - |
#f1f1f1 | #121212 |
| Surface | - |
#fff | #1a1a1a |
| Raised surface | - |
#fff | #282828 |
| Secondary surface | - |
#f7f7f7 | #282828 |
| Media surface | - |
#f7f7f7 | #f7f7f7 |
| Border | - |
#e3e3e3 | #ffffff17 |
| Strong border | - |
#8a8a8a | #aaa |
| Focus border | - |
--, #303030) |
#eee |
| Accent | - |
#303030 | #eee |
| On accent | - |
#fff | #1a1a1a |
| Rating | - |
#b77900 | #f5c542 |
| Muted rating | - |
#d9d9d9 | #6d7175 |
| Critical | - |
#c5280c | #ff9a8a |
| Elevation tier 1 | - |
0 0 0 1px rgb(0 0 0 / 0.06), 0 1px 2px rgb(0 0 0 / 0.08) | 0 0 0 1px rgb(255 255 255 / 0.1), 0 1px 2px rgb(0 0 0 / 0.4) |
| Elevation tier 2 | - |
0 0 0 1px rgb(0 0 0 / 0.06), 0 2px 4px rgb(0 0 0 / 0.06), 0 8px 24px -8px rgb(0 0 0 / 0.28) | 0 0 0 1px rgb(255 255 255 / 0.12), 0 2px 4px rgb(0 0 0 / 0.3), 0 8px 24px -8px rgb(0 0 0 / 0.7) |
| Elevation tier 3 | - |
0 0 0 1px rgb(0 0 0 / 0.07), 0 4px 8px rgb(0 0 0 / 0.06), 0 24px 56px -12px rgb(0 0 0 / 0.32) | 0 0 0 1px rgb(255 255 255 / 0.12), 0 4px 8px rgb(0 0 0 / 0.3), 0 24px 56px -12px rgb(0 0 0 / 0.72) |
| Card hover shadow | - |
0 0 0 1px rgb(0 0 0 / 0.06), 0 2px 4px rgb(0 0 0 / 0.06), 0 4px 12px -4px rgb(0 0 0 / 0.18) | 0 0 0 1px rgb(255 255 255 / 0.12), 0 2px 4px rgb(0 0 0 / 0.3), 0 4px 12px -4px rgb(0 0 0 / 0.54) |
AI Mode
Variables
| Part | Token | Light | Dark |
|---|---|---|---|
| Text | - |
#303030 | - |
| Secondary text | - |
#616161 | - |
| Disabled text | - |
#767676 | #999 |
| Link | - |
#303030 | - |
| Page background | - |
#f1f1f1 | #121212 |
| Surface | - |
#fff | - |
| Raised surface | - |
#fff | - |
| Secondary surface | - |
#f7f7f7 | #282828 |
| Media surface | - |
#f7f7f7 | #f7f7f7 |
| Border | - |
#e3e3e3 | - |
| Strong border | - |
#8a8a8a | #aaa |
| Focus border | - |
#303030 | - |
| Accent | - |
#303030 | --, #8b7be8) |
| On accent | - |
#fff | --, #fff) |
| Rating | - |
#b77900 | #f5c542 |
| Muted rating | - |
#d9d9d9 | #6d7175 |
| Critical | - |
#c5280c | #ff9a8a |
| Elevation tier 1 | - |
0 0 0 1px rgb(0 0 0 / 0.06), 0 1px 2px rgb(0 0 0 / 0.08) | 0 0 0 1px rgb(255 255 255 / 0.1), 0 1px 2px rgb(0 0 0 / 0.4) |
| Elevation tier 2 | - |
0 0 0 1px rgb(0 0 0 / 0.06), 0 2px 4px rgb(0 0 0 / 0.06), 0 8px 24px -8px rgb(0 0 0 / 0.28) | 0 0 0 1px rgb(255 255 255 / 0.12), 0 2px 4px rgb(0 0 0 / 0.3), 0 8px 24px -8px rgb(0 0 0 / 0.7) |
| Elevation tier 3 | - |
0 0 0 1px rgb(0 0 0 / 0.07), 0 4px 8px rgb(0 0 0 / 0.06), 0 24px 56px -12px rgb(0 0 0 / 0.32) | 0 0 0 1px rgb(255 255 255 / 0.12), 0 4px 8px rgb(0 0 0 / 0.3), 0 24px 56px -12px rgb(0 0 0 / 0.72) |
| Card hover shadow | - |
0 0 0 1px rgb(0 0 0 / 0.06), 0 2px 4px rgb(0 0 0 / 0.06), 0 4px 12px -4px rgb(0 0 0 / 0.18) | 0 0 0 1px rgb(255 255 255 / 0.12), 0 2px 4px rgb(0 0 0 / 0.3), 0 4px 12px -4px rgb(0 0 0 / 0.54) |
Admin
Variables
| Part | Token | Light | Dark |
|---|---|---|---|
| Text | - |
- |
No Dark skin |
| Secondary text | - |
- |
No Dark skin |
| Disabled text | - |
- |
No Dark skin |
| Link | - |
- |
No Dark skin |
| Page background | - |
- |
No Dark skin |
| Surface | - |
- |
No Dark skin |
| Raised surface | - |
- |
No Dark skin |
| Secondary surface | - |
- |
No Dark skin |
| Media surface | - |
#f7f7f7 | No Dark skin |
| Border | - |
- |
No Dark skin |
| Strong border | - |
- |
No Dark skin |
| Focus border | - |
- |
No Dark skin |
| Accent | - |
- |
No Dark skin |
| On accent | - |
- |
No Dark skin |
| Rating | - |
- |
No Dark skin |
| Muted rating | - |
- |
No Dark skin |
| Critical | - |
- |
No Dark skin |
| Elevation tier 1 | - |
- |
No Dark skin |
| Elevation tier 2 | - |
- |
No Dark skin |
| Elevation tier 3 | - |
- |
No Dark skin |
Composed values
| Element | Surface | Light | Dark | Fallback |
|---|---|---|---|---|
| Focus border | Classic | - |
#eee | var(-, #303030) |
| Accent hover | AI Mode | - |
Cùng biểu thức | - |
| Accent wash | AI Mode | - |
Cùng biểu thức | - |
| Accent glow soft | AI Mode | - |
Cùng biểu thức | - |
| Accent glow strong | AI Mode | - |
Cùng biểu thức | - |
| Field focus halo | AI Mode | - |
Cùng biểu thức | - |
| Warning fill | AI Mode | - |
- |
- |
| Elevation 1 alias | AI Mode | - |
Cùng alias | Không khai báo |
| Elevation 2 alias | AI Mode | - |
Cùng alias | Không khai báo |
| Elevation 3 alias | AI Mode | - |
Cùng alias | Không khai báo |
| Elevation tier 1 | Admin | - |
No Dark skin | Shadow storefront tier 1 |
| Elevation tier 2 | Admin | - |
No Dark skin | Shadow storefront tier 2 |
| Elevation tier 3 | Admin | - |
No Dark skin | Shadow storefront tier 3 |
Cặp text và surface lấy từ token Classic.
Show code
import React from 'react';
export function Palette() {
return (
<div style={{display: 'grid', gap: 'var(--chatty-space-400)'}}>
{['bg-surface', 'bg-surface-raised', 'bg-surface-secondary'].map(role => (
<div key={role} data-swatch={role} style={{padding: 'var(--chatty-space-400)', background: `var(--chatty-color-${role})`, color: 'var(--chatty-color-text)'}}>
<div className="chatty-type-body-medium">Primary text</div>
<div className="chatty-type-body-small" style={{color: 'var(--chatty-color-text-secondary)'}}>Secondary text</div>
<div className="chatty-type-body-small">{role}</div>
</div>
))}
</div>
);
}Mẫu tier 0–3 theo token Classic.
Show code
import React from 'react';
export function Elevation() {
return (
<div style={{display: 'grid', gap: 'var(--chatty-space-800)', padding: 'var(--chatty-space-600)'}}>
{[0, 1, 2, 3].map(tier => (
<div key={tier} data-tier={tier} className="chatty-type-body-medium" style={{padding: 'var(--chatty-space-400)', color: 'var(--chatty-color-text)', background: 'var(--chatty-color-bg-surface-raised)', boxShadow: tier ? `var(--chatty-shadow-${tier})` : 'none'}}>
Tier {tier}
</div>
))}
</div>
);
}Cặp text và surface lấy từ token AI Mode.
Show code
import React from 'react';
export function Palette() {
return (
<div style={{display: 'grid', gap: 'var(--chatty-space-400)'}}>
{['bg-surface', 'bg-surface-raised', 'bg-surface-secondary'].map(role => (
<div key={role} data-swatch={role} style={{padding: 'var(--chatty-space-400)', background: `var(--chatty-color-${role})`, color: 'var(--chatty-color-text)'}}>
<div className="chatty-type-body-medium">Primary text</div>
<div className="chatty-type-body-small" style={{color: 'var(--chatty-color-text-secondary)'}}>Secondary text</div>
<div className="chatty-type-body-small">{role}</div>
</div>
))}
</div>
);
}Mẫu tier 0–3 theo token AI Mode.
Show code
import React from 'react';
export function Elevation() {
return (
<div style={{display: 'grid', gap: 'var(--chatty-space-800)', padding: 'var(--chatty-space-600)'}}>
{[0, 1, 2, 3].map(tier => (
<div key={tier} data-tier={tier} className="chatty-type-body-medium" style={{padding: 'var(--chatty-space-400)', color: 'var(--chatty-color-text)', background: 'var(--chatty-color-bg-surface-raised)', boxShadow: tier ? `var(--chatty-shadow-${tier})` : 'none'}}>
Tier {tier}
</div>
))}
</div>
);
}Cặp text và surface lấy từ token Admin.
Show code
import React from 'react';
export function Palette() {
return (
<div style={{display: 'grid', gap: 'var(--chatty-space-400)'}}>
{['bg-surface', 'bg-surface-raised', 'bg-surface-secondary'].map(role => (
<div key={role} data-swatch={role} style={{padding: 'var(--chatty-space-400)', background: `var(--chatty-color-${role})`, color: 'var(--chatty-color-text)'}}>
<div className="chatty-type-body-medium">Primary text</div>
<div className="chatty-type-body-small" style={{color: 'var(--chatty-color-text-secondary)'}}>Secondary text</div>
<div className="chatty-type-body-small">{role}</div>
</div>
))}
</div>
);
}Mẫu tier 0–3 theo token Admin.
Show code
import React from 'react';
export function Elevation() {
return (
<div style={{display: 'grid', gap: 'var(--chatty-space-800)', padding: 'var(--chatty-space-600)'}}>
{[0, 1, 2, 3].map(tier => (
<div key={tier} data-tier={tier} className="chatty-type-body-medium" style={{padding: 'var(--chatty-space-400)', color: 'var(--chatty-color-text)', background: 'var(--chatty-color-bg-surface-raised)', boxShadow: tier ? `var(--chatty-shadow-${tier})` : 'none'}}>
Tier {tier}
</div>
))}
</div>
);
}Copy-paste export
Classic
.Avada-Faqs_Popup {
--chatty-color-text: #303030;
--chatty-color-text-secondary: #616161;
--chatty-color-text-disabled: #767676;
--chatty-color-text-link: #303030;
--chatty-color-bg: #f1f1f1;
--chatty-color-bg-surface: #fff;
--chatty-color-bg-surface-raised: #fff;
--chatty-color-bg-surface-secondary: #f7f7f7;
--chatty-color-bg-media: #f7f7f7;
--chatty-color-border: #e3e3e3;
--chatty-color-border-strong: #8a8a8a;
--chatty-color-border-focus: var(--chatty-ring);
--chatty-color-accent: #303030;
--chatty-color-on-accent: #fff;
--chatty-color-rating: #b77900;
--chatty-color-rating-muted: #d9d9d9;
--chatty-color-critical: #c5280c;
--chatty-shadow-1: 0 0 0 1px rgb(0 0 0 / 0.06), 0 1px 2px rgb(0 0 0 / 0.08);
--chatty-shadow-2:
0 0 0 1px rgb(0 0 0 / 0.06), 0 2px 4px rgb(0 0 0 / 0.06), 0 8px 24px -8px rgb(0 0 0 / 0.28);
--chatty-shadow-3:
0 0 0 1px rgb(0 0 0 / 0.07), 0 4px 8px rgb(0 0 0 / 0.06), 0 24px 56px -12px rgb(0 0 0 / 0.32);
--chatty-shadow-card-hover:
0 0 0 1px rgb(0 0 0 / 0.06), 0 2px 4px rgb(0 0 0 / 0.06), 0 4px 12px -4px rgb(0 0 0 / 0.18);
--chatty-ring: var(--faqsTextColor, #303030);
--chatty-error: #c63f4b;
--chatty-link: var(--faqsTextColor, #303030);
--chatty-field-ring: #c4c4c4;
--chatty-form-border: #8a8a8a;
--chatty-control: #000000;
}
.Avada-Faqs_Popup[data-theme="dark"] {
--chatty-color-text: #eee;
--chatty-color-text-secondary: #aaa;
--chatty-color-text-disabled: #999;
--chatty-color-text-link: #eee;
--chatty-color-bg: #121212;
--chatty-color-bg-surface: #1a1a1a;
--chatty-color-bg-surface-raised: #282828;
--chatty-color-bg-surface-secondary: #282828;
--chatty-color-bg-media: #f7f7f7;
--chatty-color-border: #ffffff17;
--chatty-color-border-strong: #aaa;
--chatty-color-border-focus: #eee;
--chatty-color-accent: #eee;
--chatty-color-on-accent: #1a1a1a;
--chatty-color-rating: #f5c542;
--chatty-color-rating-muted: #6d7175;
--chatty-color-critical: #ff9a8a;
--chatty-shadow-1: 0 0 0 1px rgb(255 255 255 / 0.1), 0 1px 2px rgb(0 0 0 / 0.4);
--chatty-shadow-2:
0 0 0 1px rgb(255 255 255 / 0.12), 0 2px 4px rgb(0 0 0 / 0.3), 0 8px 24px -8px rgb(0 0 0 / 0.7);
--chatty-shadow-3:
0 0 0 1px rgb(255 255 255 / 0.12), 0 4px 8px rgb(0 0 0 / 0.3),
0 24px 56px -12px rgb(0 0 0 / 0.72);
--chatty-shadow-card-hover:
0 0 0 1px rgb(255 255 255 / 0.12), 0 2px 4px rgb(0 0 0 / 0.3), 0 4px 12px -4px rgb(0 0 0 / 0.54);
--chatty-ring: var(--faqsTextColor, #eee);
--chatty-error: #ff9aa2;
--chatty-link: var(--faqsTextColor, #eee);
--chatty-field-ring: #b0b0b0;
--chatty-form-border: #b0b0b0;
--chatty-control: #ffffff;
}
AI Mode
.chatty-ai-mode {
--bg-deep: #131215;
--bg-elevated: #1c1b1f;
--accent: var(--faqsBtnPopupColor, #8b7be8);
--on-accent: var(--faqsFloatBtnLabelColor, #fff);
--vib-1: rgba(255, 255, 255, 0.96);
--vib-2: rgba(255, 255, 255, 0.74);
--glass-edge: rgba(255, 255, 255, 0.12);
--chatty-color-text: var(--vib-1);
--chatty-color-text-secondary: var(--vib-2);
--chatty-color-text-disabled: #999;
--chatty-color-text-link: var(--vib-1);
--chatty-color-bg: #121212;
--chatty-color-bg-surface: var(--bg-deep);
--chatty-color-bg-surface-raised: var(--bg-elevated);
--chatty-color-bg-surface-secondary: #282828;
--chatty-color-bg-media: #f7f7f7;
--chatty-color-border: var(--glass-edge);
--chatty-color-border-strong: #aaa;
--chatty-color-border-focus: var(--vib-1);
--chatty-color-accent: var(--accent);
--chatty-color-on-accent: var(--on-accent);
--chatty-color-rating: #f5c542;
--chatty-color-rating-muted: #6d7175;
--chatty-color-critical: #ff9a8a;
--chatty-shadow-1: 0 0 0 1px rgb(255 255 255 / 0.1), 0 1px 2px rgb(0 0 0 / 0.4);
--chatty-shadow-2:
0 0 0 1px rgb(255 255 255 / 0.12), 0 2px 4px rgb(0 0 0 / 0.3), 0 8px 24px -8px rgb(0 0 0 / 0.7);
--chatty-shadow-3:
0 0 0 1px rgb(255 255 255 / 0.12), 0 4px 8px rgb(0 0 0 / 0.3),
0 24px 56px -12px rgb(0 0 0 / 0.72);
--chatty-shadow-card-hover:
0 0 0 1px rgb(255 255 255 / 0.12), 0 2px 4px rgb(0 0 0 / 0.3), 0 4px 12px -4px rgb(0 0 0 / 0.54);
}
.chatty-ai-mode[data-theme="light"] {
--bg-deep: #f6f4f0;
--bg-elevated: #fbfaf7;
--vib-1: rgba(20, 19, 24, 0.94);
--vib-2: rgba(20, 19, 24, 0.74);
--glass-edge: rgba(20, 19, 24, 0.08);
--chatty-color-text: #303030;
--chatty-color-text-secondary: #616161;
--chatty-color-text-disabled: #767676;
--chatty-color-text-link: #303030;
--chatty-color-bg: #f1f1f1;
--chatty-color-bg-surface: #fff;
--chatty-color-bg-surface-raised: #fff;
--chatty-color-bg-surface-secondary: #f7f7f7;
--chatty-color-bg-media: #f7f7f7;
--chatty-color-border: #e3e3e3;
--chatty-color-border-strong: #8a8a8a;
--chatty-color-border-focus: #303030;
--chatty-color-accent: #303030;
--chatty-color-on-accent: #fff;
--chatty-color-rating: #b77900;
--chatty-color-rating-muted: #d9d9d9;
--chatty-color-critical: #c5280c;
--chatty-shadow-1: 0 0 0 1px rgb(0 0 0 / 0.06), 0 1px 2px rgb(0 0 0 / 0.08);
--chatty-shadow-2:
0 0 0 1px rgb(0 0 0 / 0.06), 0 2px 4px rgb(0 0 0 / 0.06), 0 8px 24px -8px rgb(0 0 0 / 0.28);
--chatty-shadow-3:
0 0 0 1px rgb(0 0 0 / 0.07), 0 4px 8px rgb(0 0 0 / 0.06), 0 24px 56px -12px rgb(0 0 0 / 0.32);
--chatty-shadow-card-hover:
0 0 0 1px rgb(0 0 0 / 0.06), 0 2px 4px rgb(0 0 0 / 0.06), 0 4px 12px -4px rgb(0 0 0 / 0.18);
}
Admin
.inbox-v2 {
--chatty-color-text: var(--p-color-text, #303030);
--chatty-color-text-secondary: var(--p-color-text-secondary, #616161);
--chatty-color-text-disabled: var(--p-color-text-disabled, #767676);
--chatty-color-text-link: var(--p-color-text-link, #005bd3);
--chatty-color-bg: var(--p-color-bg, #f1f1f1);
--chatty-color-bg-surface: var(--p-color-bg-surface, #fff);
--chatty-color-bg-surface-raised: var(--p-color-bg-surface-raised, #fff);
--chatty-color-bg-surface-secondary: var(--p-color-bg-surface-secondary, #f7f7f7);
--chatty-color-bg-media: #f7f7f7;
--chatty-color-border: var(--p-color-border, #e3e3e3);
--chatty-color-border-strong: var(--p-color-border-strong, #8a8a8a);
--chatty-color-border-focus: var(--p-color-border-focus, #005bd3);
--chatty-color-accent: var(--p-color-accent, #303030);
--chatty-color-on-accent: var(--p-color-on-accent, #fff);
--chatty-color-rating: var(--p-color-rating, #b77900);
--chatty-color-rating-muted: var(--p-color-rating-muted, #d9d9d9);
--chatty-color-critical: var(--p-color-critical, #c5280c);
--chatty-shadow-1: var(--p-shadow-100, 0 0 0 1px rgb(0 0 0 / 0.06), 0 1px 2px rgb(0 0 0 / 0.08));
--chatty-shadow-2: var(
--p-shadow-300,
0 0 0 1px rgb(0 0 0 / 0.06),
0 2px 4px rgb(0 0 0 / 0.06),
0 8px 24px -8px rgb(0 0 0 / 0.28)
);
--chatty-shadow-3: var(
--p-shadow-600,
0 0 0 1px rgb(0 0 0 / 0.07),
0 4px 8px rgb(0 0 0 / 0.06),
0 24px 56px -12px rgb(0 0 0 / 0.32)
);
}
Contrast matrix
| Surface | Pair | Light ratio | Dark ratio |
|---|---|---|---|
| Classic | - |
13.20:1Measured(#303030 / #ffffff = 13.20:1) | 15.00:1Measured(#eeeeee / #1a1a1a = 15.00:1) |
| Classic | - |
6.19:1Measured(#616161 / #ffffff = 6.19:1) | 7.49:1Measured(#aaaaaa / #1a1a1a = 7.49:1) |
| Classic | - |
4.54:1Measured(#767676 / #ffffff = 4.54:1) | 6.11:1Measured(#999999 / #1a1a1a = 6.11:1) |
| Classic | - |
3.45:1Measured(#8a8a8a / #ffffff = 3.45:1) | 7.49:1Measured(#aaaaaa / #1a1a1a = 7.49:1) |
| Classic | - |
13.20:1Measured(#ffffff / #303030 = 13.20:1) | 15.00:1Measured(#1a1a1a / #eeeeee = 15.00:1) |
| Classic | - |
5.70:1Measured(#c5280c / #ffffff = 5.70:1) | 8.49:1Measured(#ff9a8a / #1a1a1a = 8.49:1) |
| AI Mode | - |
13.20:1Measured(#303030 / #ffffff = 13.20:1) | 17.20:1Measured(rgba(255, 255, 255, 0.96) / #131215 = 17.20:1) |
| AI Mode | - |
6.19:1Measured(#616161 / #ffffff = 6.19:1) | 10.42:1Measured(rgba(255, 255, 255, 0.74) / #131215 = 10.42:1) |
| AI Mode | - |
13.20:1Measured(#ffffff / #303030 = 13.20:1) | 3.44:1Measured(#ffffff / #8b7be8 = 3.44:1) |
| AI Mode | - |
5.70:1Measured(#c5280c / #ffffff = 5.70:1) | 9.10:1Measured(#ff9a8a / #131215 = 9.10:1) |
| Admin | - |
12.32:1Measured(#303030 / #f7f7f7 = 12.32:1) | No Dark skin |
| Admin | - |
5.70:1Measured(#005bd3 / #f7f7f7 = 5.70:1) | No Dark skin |
Target
Giá trị thiết kế đối chiếu Polaris 2.0 runtime, không phải màu đã ship của Inbox hiện tại. Tên token màu admin ghép prefix --chatty-color- với role trong cột Now dưới đây (ví dụ role bg thành --chatty-color-bg).
Target: mẫu giá trị Inbox được duyệt; không phải implementation production.
Show code
import React from 'react';
const radii = {"container": "20px", "dialog": "20px", "popover": "12px", "control": "10px", "element": "8px", "tag": "6px", "checkbox": "4px", "avatar": "clamp(6px, 30%, 12px)", "action": "9999px", "chat-control": ".5rem", "option-item": ".5rem", "kbd": ".25rem"};
const themes = {"light": {"--chatty-color-bg": "#fff", "--chatty-color-bg-fill-caution-secondary": "oklch(.9167 .1785 98.00)", "--chatty-color-bg-fill-critical": "oklch(.9470 .0300 20.50)", "--chatty-color-bg-fill-info-secondary": "oklch(.8637 .1018 216.95)", "--chatty-color-bg-fill-inverse": "#1b1b1b", "--chatty-color-bg-fill-secondary": "#ebebeb", "--chatty-color-bg-fill-success": "oklch(.9672 .0599 131.73)", "--chatty-color-bg-fill-success-secondary": "oklch(.9053 .1942 133.49)", "--chatty-color-bg-fill-tertiary": "#ddd", "--chatty-color-bg-fill-tertiary-hover": "#d0d0d0", "--chatty-color-bg-surface": "#fff", "--chatty-color-bg-surface-critical": "oklch(.9470 .0300 20.50)", "--chatty-color-bg-surface-secondary": "#f7f7f7", "--chatty-color-bg-surface-secondary-selected": "#ebebeb", "--chatty-color-bg-surface-success": "oklch(.9672 .0599 131.73)", "--chatty-color-bg-surface-tertiary": "#f2f2f2", "--chatty-color-bg-surface-warning": "oklch(.9557 .0350 67.45)", "--chatty-color-border": "rgba(221,221,221,1)", "--chatty-color-border-secondary": "rgba(242,242,242,1)", "--chatty-color-border-tertiary": "rgba(192,192,192,1)", "--chatty-color-border-warning": "oklch(.9316 .0545 67.18)", "--chatty-color-icon-secondary": "#606060", "--chatty-color-text": "#101010", "--chatty-color-text-brand-on-accent": "#fff", "--chatty-color-text-caution": "oklch(.2708 .0638 90.28)", "--chatty-color-text-critical": "oklch(.2121 .0942 30.90)", "--chatty-color-text-info": "oklch(.2715 .0576 221.37)", "--chatty-color-text-link": "oklch(.4840 .2413 262.80)", "--chatty-color-text-link-inverse": "oklch(.7340 .1449 264.63)", "--chatty-color-text-on-accent": "#fff", "--chatty-color-text-secondary": "rgba(74,74,74,1)", "--chatty-color-text-success": "oklch(.2334 .0796 134.14)", "--chatty-color-text-warning": "oklch(.2475 .0726 51.49)"}, "dark": {"--chatty-color-bg": "#121212", "--chatty-color-bg-fill-caution-secondary": "#4f4700", "--chatty-color-bg-fill-critical": "#2f040b", "--chatty-color-bg-fill-info-secondary": "#003a5a", "--chatty-color-bg-fill-inverse": "#303030", "--chatty-color-bg-fill-secondary": "#373737", "--chatty-color-bg-fill-success": "#014b40", "--chatty-color-bg-fill-success-secondary": "#014b40", "--chatty-color-bg-fill-tertiary": "#414141", "--chatty-color-bg-fill-tertiary-hover": "#585858", "--chatty-color-bg-surface": "#1a1a1a", "--chatty-color-bg-surface-critical": "#5f0716", "--chatty-color-bg-surface-secondary": "#282828", "--chatty-color-bg-surface-secondary-selected": "#373737", "--chatty-color-bg-surface-success": "#073630", "--chatty-color-bg-surface-tertiary": "#2f2f2f", "--chatty-color-bg-surface-warning": "#412d00", "--chatty-color-border": "#ffffff17", "--chatty-color-border-secondary": "#ffffff0f", "--chatty-color-border-tertiary": "#ffffff2e", "--chatty-color-border-warning": "#956f00", "--chatty-color-icon-secondary": "#aaa", "--chatty-color-text": "#eee", "--chatty-color-text-brand-on-accent": "#121212", "--chatty-color-text-caution": "#ffeb78", "--chatty-color-text-critical": "#f78086", "--chatty-color-text-info": "#a8d8ff", "--chatty-color-text-link": "#c5d0ff", "--chatty-color-text-link-inverse": "#c5d0ff", "--chatty-color-text-on-accent": "#121212", "--chatty-color-text-secondary": "#aaa", "--chatty-color-text-success": "#2ced83", "--chatty-color-text-warning": "#ffc879"}};
const frameStyle = {
...themes.light,
...Object.fromEntries(Object.entries(radii).map(([role,value])=>['--chatty-radius-'+role,value])),
'--chatty-type-family':'ShopifyInter, ui-sans-serif, system-ui, sans-serif',
'--chatty-type-weight-regular':400,'--chatty-type-weight-medium':500,'--chatty-type-weight-semibold':600,
'--chatty-type-body-medium-size':'13px','--chatty-type-body-medium-line':'20px',
'--chatty-type-button-label-size':'12px','--chatty-type-button-label-line':'16px',
'--chatty-type-badge-label-size':'12px','--chatty-type-badge-label-line':'18px',
fontFamily:'var(--chatty-type-family)',fontSize:'var(--chatty-type-body-medium-size)',lineHeight:'var(--chatty-type-body-medium-line)',fontWeight:'var(--chatty-type-weight-regular)',
color:'var(--chatty-color-text)',background:'var(--chatty-color-bg-surface)',padding:16
};
const box = {border:'1px solid #888',background:'#f7f7f7',padding:12,color:'#101010',font:'inherit'};
function Target({children}) { return <div data-inbox-target style={frameStyle}><link rel="stylesheet" href="https://cdn.shopify.com/static/fonts/shopifyinter/v0/styles.css"/><p style={{marginTop:0}}>Target · design fixture · phase 1b chưa ship</p>{children}</div>; }
function RadiusSample({role,value}) {
const style={...box,borderRadius:`var(--chatty-radius-${role})`};
if(role==='checkbox')return <input aria-label="Checkbox radius sample" type="checkbox" style={{...style,appearance:'none',width:24,height:24,padding:0}}/>;
if(role==='avatar')return <span role="img" aria-label="Avatar initials" style={{...style,width:36,height:36,padding:0,display:'grid',placeItems:'center'}}>AB</span>;
if(role==='tag')return <span style={{...style,padding:'0 8px',display:'inline-block'}}>Status</span>;
if(role==='kbd')return <kbd style={{...style,padding:'0 6px'}}>A</kbd>;
if(['action','control','chat-control','option-item'].includes(role))return <button type="button" style={style}>Action</button>;
if(role==='dialog')return <dialog open aria-label="Dialog radius sample" style={{...style,position:'static',margin:0}}>Dialog</dialog>;
return <section aria-label={`${role} radius sample`} style={style}>{role}</section>;
}
export function Colours() {
return <Target><div style={{display:'grid',gridTemplateColumns:'repeat(auto-fit,minmax(220px,1fr))',gap:16}}>{Object.entries(themes).map(([theme,tokens])=><section data-target-theme={theme} key={theme} style={{...tokens,background:'var(--chatty-color-bg-surface)',color:'var(--chatty-color-text)',padding:12,border:'1px solid #888'}}><h3 style={{fontSize:13,fontWeight:'var(--chatty-type-weight-medium)'}}>{theme}</h3>{Object.entries(tokens).map(([name,value])=><div key={name} data-colour-role={name} style={{display:'grid',gridTemplateColumns:'32px minmax(0,1fr)',gap:8,marginBottom:12}}><span aria-hidden="true" style={{background:`var(${name})`,border:'1px solid #888',height:32}}/><span style={{overflowWrap:'anywhere'}}>{name.replace('--chatty-color-','')}<br/>{value}</span></div>)}</section>)}</div></Target>;
}Target: kích thước admin và nút primary Light/Dark.
Show code
import React from 'react';
const radii = {"container": "20px", "dialog": "20px", "popover": "12px", "control": "10px", "element": "8px", "tag": "6px", "checkbox": "4px", "avatar": "clamp(6px, 30%, 12px)", "action": "9999px", "chat-control": ".5rem", "option-item": ".5rem", "kbd": ".25rem"};
const themes = {"light": {"--chatty-color-bg": "#fff", "--chatty-color-bg-fill-caution-secondary": "oklch(.9167 .1785 98.00)", "--chatty-color-bg-fill-critical": "oklch(.9470 .0300 20.50)", "--chatty-color-bg-fill-info-secondary": "oklch(.8637 .1018 216.95)", "--chatty-color-bg-fill-inverse": "#1b1b1b", "--chatty-color-bg-fill-secondary": "#ebebeb", "--chatty-color-bg-fill-success": "oklch(.9672 .0599 131.73)", "--chatty-color-bg-fill-success-secondary": "oklch(.9053 .1942 133.49)", "--chatty-color-bg-fill-tertiary": "#ddd", "--chatty-color-bg-fill-tertiary-hover": "#d0d0d0", "--chatty-color-bg-surface": "#fff", "--chatty-color-bg-surface-critical": "oklch(.9470 .0300 20.50)", "--chatty-color-bg-surface-secondary": "#f7f7f7", "--chatty-color-bg-surface-secondary-selected": "#ebebeb", "--chatty-color-bg-surface-success": "oklch(.9672 .0599 131.73)", "--chatty-color-bg-surface-tertiary": "#f2f2f2", "--chatty-color-bg-surface-warning": "oklch(.9557 .0350 67.45)", "--chatty-color-border": "rgba(221,221,221,1)", "--chatty-color-border-secondary": "rgba(242,242,242,1)", "--chatty-color-border-tertiary": "rgba(192,192,192,1)", "--chatty-color-border-warning": "oklch(.9316 .0545 67.18)", "--chatty-color-icon-secondary": "#606060", "--chatty-color-text": "#101010", "--chatty-color-text-brand-on-accent": "#fff", "--chatty-color-text-caution": "oklch(.2708 .0638 90.28)", "--chatty-color-text-critical": "oklch(.2121 .0942 30.90)", "--chatty-color-text-info": "oklch(.2715 .0576 221.37)", "--chatty-color-text-link": "oklch(.4840 .2413 262.80)", "--chatty-color-text-link-inverse": "oklch(.7340 .1449 264.63)", "--chatty-color-text-on-accent": "#fff", "--chatty-color-text-secondary": "rgba(74,74,74,1)", "--chatty-color-text-success": "oklch(.2334 .0796 134.14)", "--chatty-color-text-warning": "oklch(.2475 .0726 51.49)"}, "dark": {"--chatty-color-bg": "#121212", "--chatty-color-bg-fill-caution-secondary": "#4f4700", "--chatty-color-bg-fill-critical": "#2f040b", "--chatty-color-bg-fill-info-secondary": "#003a5a", "--chatty-color-bg-fill-inverse": "#303030", "--chatty-color-bg-fill-secondary": "#373737", "--chatty-color-bg-fill-success": "#014b40", "--chatty-color-bg-fill-success-secondary": "#014b40", "--chatty-color-bg-fill-tertiary": "#414141", "--chatty-color-bg-fill-tertiary-hover": "#585858", "--chatty-color-bg-surface": "#1a1a1a", "--chatty-color-bg-surface-critical": "#5f0716", "--chatty-color-bg-surface-secondary": "#282828", "--chatty-color-bg-surface-secondary-selected": "#373737", "--chatty-color-bg-surface-success": "#073630", "--chatty-color-bg-surface-tertiary": "#2f2f2f", "--chatty-color-bg-surface-warning": "#412d00", "--chatty-color-border": "#ffffff17", "--chatty-color-border-secondary": "#ffffff0f", "--chatty-color-border-tertiary": "#ffffff2e", "--chatty-color-border-warning": "#956f00", "--chatty-color-icon-secondary": "#aaa", "--chatty-color-text": "#eee", "--chatty-color-text-brand-on-accent": "#121212", "--chatty-color-text-caution": "#ffeb78", "--chatty-color-text-critical": "#f78086", "--chatty-color-text-info": "#a8d8ff", "--chatty-color-text-link": "#c5d0ff", "--chatty-color-text-link-inverse": "#c5d0ff", "--chatty-color-text-on-accent": "#121212", "--chatty-color-text-secondary": "#aaa", "--chatty-color-text-success": "#2ced83", "--chatty-color-text-warning": "#ffc879"}};
const frameStyle = {
...themes.light,
...Object.fromEntries(Object.entries(radii).map(([role,value])=>['--chatty-radius-'+role,value])),
'--chatty-type-family':'ShopifyInter, ui-sans-serif, system-ui, sans-serif',
'--chatty-type-weight-regular':400,'--chatty-type-weight-medium':500,'--chatty-type-weight-semibold':600,
'--chatty-type-body-medium-size':'13px','--chatty-type-body-medium-line':'20px',
'--chatty-type-button-label-size':'12px','--chatty-type-button-label-line':'16px',
'--chatty-type-badge-label-size':'12px','--chatty-type-badge-label-line':'18px',
fontFamily:'var(--chatty-type-family)',fontSize:'var(--chatty-type-body-medium-size)',lineHeight:'var(--chatty-type-body-medium-line)',fontWeight:'var(--chatty-type-weight-regular)',
color:'var(--chatty-color-text)',background:'var(--chatty-color-bg-surface)',padding:16
};
const box = {border:'1px solid #888',background:'#f7f7f7',padding:12,color:'#101010',font:'inherit'};
function Target({children}) { return <div data-inbox-target style={frameStyle}><link rel="stylesheet" href="https://cdn.shopify.com/static/fonts/shopifyinter/v0/styles.css"/><p style={{marginTop:0}}>Target · design fixture · phase 1b chưa ship</p>{children}</div>; }
function RadiusSample({role,value}) {
const style={...box,borderRadius:`var(--chatty-radius-${role})`};
if(role==='checkbox')return <input aria-label="Checkbox radius sample" type="checkbox" style={{...style,appearance:'none',width:24,height:24,padding:0}}/>;
if(role==='avatar')return <span role="img" aria-label="Avatar initials" style={{...style,width:36,height:36,padding:0,display:'grid',placeItems:'center'}}>AB</span>;
if(role==='tag')return <span style={{...style,padding:'0 8px',display:'inline-block'}}>Status</span>;
if(role==='kbd')return <kbd style={{...style,padding:'0 6px'}}>A</kbd>;
if(['action','control','chat-control','option-item'].includes(role))return <button type="button" style={style}>Action</button>;
if(role==='dialog')return <dialog open aria-label="Dialog radius sample" style={{...style,position:'static',margin:0}}>Dialog</dialog>;
return <section aria-label={`${role} radius sample`} style={style}>{role}</section>;
}
export function Buttons() {
return <Target><div style={{display:'flex',gap:16,flexWrap:'wrap'}}>{['light','dark'].map(theme=><div key={theme} data-primary-theme={theme} style={{padding:16,background:theme==='dark'?'#1a1a1a':'#fff',color:theme==='dark'?'#eee':'#101010','--chatty-color-action-primary-bg':theme==='dark'?'#fcfcfc':'#101010','--chatty-color-action-primary-fg':theme==='dark'?'#121212':'#fff'}}><p>{theme} · Target</p><button data-admin-primary type="button" style={{font:'var(--chatty-type-weight-medium) var(--chatty-type-button-label-size)/var(--chatty-type-button-label-line) var(--chatty-type-family)',height:28,padding:'0 12px',borderRadius:'var(--chatty-radius-action)',border:0,background:'var(--chatty-color-action-primary-bg)',color:'var(--chatty-color-action-primary-fg)'}}>Assign to me <kbd style={{font:'inherit',borderRadius:'var(--chatty-radius-kbd)'}}>A</kbd></button><span data-admin-badge style={{display:'inline-flex',height:20,alignItems:'center',marginInlineStart:8,padding:'0 6px',fontSize:'var(--chatty-type-badge-label-size)',lineHeight:'var(--chatty-type-badge-label-line)',fontWeight:'var(--chatty-type-weight-medium)',borderRadius:'var(--chatty-radius-tag)',border:'1px solid currentColor'}}>Status</span></div>)}</div><p>BFS 4.1.1: nút chính đen/trắng; màu brand không đạt điều kiện. Giá trị 2.0, component chatty-ui.</p></Target>;
}