Key rules
- Classic: chọn role theo chức năng của chữ và đọc
--chatty-type-<role>-size; không đặt font-size rời cho text của chat. - AI Mode: role mixin hoặc class
chatty-type-<role>; mobile bật bằngis-mobilehoặc media query pointer thô. - Admin: role phát ra rem và có tracking riêng; mobile đổi bằng media query của admin.
- Classic: weight storefront khác Polaris ở heading-large, heading-medium, heading-small, body-x-small; Admin giữ weight của bảng role.
- Classic: storefront cộng
$storefront-step; Admin dùng tuple gốc.
On this page
Where tokens live
| Surface | File | Scope root | Theme switch |
|---|---|---|---|
| Classic | _ |
.Avada- |
Không đổi theo theme; class mobile gọi thêm mixin mobile |
| AI Mode | _ |
.chatty- |
Không đổi theo theme; class is- |
| Admin | _ |
.inbox- |
Không đổi theo theme; media query của admin gọi thêm mixin mobile |
How to apply
| Surface | API / class | Example |
|---|---|---|
| Classic | Sass mixin phát token | @include type. |
| Classic | Role phát CSS | font- |
| Classic | Typography của chatty- |
<Typography variant="body1"> |
| AI Mode | Sass role mixin | @include type. |
| AI Mode | Sass mixin phát token | @include type. |
| Admin | Sass role mixin | @include type. |
| Admin | Sass mixin phát token | @include type. |
Element map
| Element | Surface | Role/Token | Light | Dark |
|---|---|---|---|---|
| Typography h1 / h2 / h3 | Classic | display- |
24pxDerived(24px = type(display- |
Same type role |
| Typography h4 / subtitle1 | Classic | heading- |
17pxDerived(17px = type(heading- |
Same type role |
| Typography h6 / subtitle2 | Classic | heading- |
15pxDerived(15px = type(heading- |
Same type role |
| Typography body1 | Classic | body- |
17pxDerived(17px = type(body- |
Same type role |
| Typography body2 | Classic | body- |
15pxDerived(15px = type(body- |
Same type role |
| Typography caption | Classic | body- |
14pxDerived(14px = type(body- |
Same type role |
| Typography overline | Classic | heading- |
14pxDerived(14px = type(heading- |
Same type role |
| Typography button | Classic | button- |
14pxDerived(14px = type(button- |
Same type role |
| Native action label | AI Mode | button- |
14pxDerived(14px = type(button- |
Same type role |
| Message bubble text | Admin | body- |
13pxDerived(13px = type(body- |
Same type role |
Tokens
Classic
Type roles
| Role | Desktop size (px) | Desktop line-height (px) | Mobile size (px) | Mobile line-height (px) | Weight | Tracking |
|---|---|---|---|---|---|---|
| display- |
24pxDerived(24px = type(display- |
30pxDerived(30px = type(display- |
22pxDerived(22px = type(display- |
28pxDerived(28px = type(display- |
500 | 0 |
| heading- |
17pxDerived(17px = type(heading- |
24pxDerived(24px = type(heading- |
19pxDerived(19px = type(heading- |
26pxDerived(26px = type(heading- |
600 | 0 |
| heading- |
15pxDerived(15px = type(heading- |
22pxDerived(22px = type(heading- |
17pxDerived(17px = type(heading- |
24pxDerived(24px = type(heading- |
600 | 0 |
| heading- |
14pxDerived(14px = type(heading- |
20pxDerived(20px = type(heading- |
15pxDerived(15px = type(heading- |
22pxDerived(22px = type(heading- |
600 | 0 |
| body- |
17pxDerived(17px = type(body- |
24pxDerived(24px = type(body- |
19pxDerived(19px = type(body- |
26pxDerived(26px = type(body- |
400 | 0 |
| body- |
15pxDerived(15px = type(body- |
22pxDerived(22px = type(body- |
17pxDerived(17px = type(body- |
24pxDerived(24px = type(body- |
400 | 0 |
| body- |
14pxDerived(14px = type(body- |
20pxDerived(20px = type(body- |
15pxDerived(15px = type(body- |
22pxDerived(22px = type(body- |
400 | 0 |
| body- |
13pxDerived(13px = type(body- |
16pxDerived(16px = type(body- |
14pxDerived(14px = type(body- |
18pxDerived(18px = type(body- |
600 | 0 |
| button- |
14pxDerived(14px = type(button- |
18pxDerived(18px = type(button- |
17pxDerived(17px = type(button- |
24pxDerived(24px = type(button- |
500 | 0 |
| chip- |
14pxDerived(14px = type(chip- |
18pxDerived(18px = type(chip- |
14pxDerived(14px = type(chip- |
18pxDerived(18px = type(chip- |
500 | 0 |
| input- |
15pxDerived(15px = type(input- |
22pxDerived(22px = type(input- |
17pxDerived(17px = type(input- |
24pxDerived(24px = type(input- |
500 | 0 |
| input- |
15pxDerived(15px = type(input- |
22pxDerived(22px = type(input- |
18pxDerived(18px = type(input- |
24pxDerived(24px = type(input- |
400 | 0 |
Breakpoints
| Name | Expression | Mechanism |
|---|---|---|
| Classic mobile | 899px | JS mobileMaxWidth config; class mobile gọi mixin mobile |
AI Mode
Type roles
| Role | Desktop size (px) | Desktop line-height (px) | Mobile size (px) | Mobile line-height (px) | Weight | Tracking |
|---|---|---|---|---|---|---|
| display- |
24pxDerived(24px = type(display- |
30pxDerived(30px = type(display- |
22pxDerived(22px = type(display- |
28pxDerived(28px = type(display- |
500 | 0 |
| heading- |
17pxDerived(17px = type(heading- |
24pxDerived(24px = type(heading- |
19pxDerived(19px = type(heading- |
26pxDerived(26px = type(heading- |
600 | 0 |
| heading- |
15pxDerived(15px = type(heading- |
22pxDerived(22px = type(heading- |
17pxDerived(17px = type(heading- |
24pxDerived(24px = type(heading- |
600 | 0 |
| heading- |
14pxDerived(14px = type(heading- |
20pxDerived(20px = type(heading- |
15pxDerived(15px = type(heading- |
22pxDerived(22px = type(heading- |
600 | 0 |
| body- |
17pxDerived(17px = type(body- |
24pxDerived(24px = type(body- |
19pxDerived(19px = type(body- |
26pxDerived(26px = type(body- |
400 | 0 |
| body- |
15pxDerived(15px = type(body- |
22pxDerived(22px = type(body- |
17pxDerived(17px = type(body- |
24pxDerived(24px = type(body- |
400 | 0 |
| body- |
14pxDerived(14px = type(body- |
20pxDerived(20px = type(body- |
15pxDerived(15px = type(body- |
22pxDerived(22px = type(body- |
400 | 0 |
| body- |
13pxDerived(13px = type(body- |
16pxDerived(16px = type(body- |
14pxDerived(14px = type(body- |
18pxDerived(18px = type(body- |
600 | 0 |
| button- |
14pxDerived(14px = type(button- |
18pxDerived(18px = type(button- |
17pxDerived(17px = type(button- |
24pxDerived(24px = type(button- |
500 | 0 |
| chip- |
14pxDerived(14px = type(chip- |
18pxDerived(18px = type(chip- |
14pxDerived(14px = type(chip- |
18pxDerived(18px = type(chip- |
500 | 0 |
| input- |
15pxDerived(15px = type(input- |
22pxDerived(22px = type(input- |
17pxDerived(17px = type(input- |
24pxDerived(24px = type(input- |
500 | 0 |
| input- |
15pxDerived(15px = type(input- |
22pxDerived(22px = type(input- |
18pxDerived(18px = type(input- |
24pxDerived(24px = type(input- |
400 | 0 |
Breakpoints
| Name | Expression | Mechanism |
|---|---|---|
| AI Mode coarse pointer | (hover: none) and (pointer: coarse) | Media query gọi mixin mobile |
| AI Mode mobile class | is- |
Class gọi mixin mobile |
Admin
Type roles
| Role | Desktop size (px) | Desktop line-height (px) | Mobile size (px) | Mobile line-height (px) | Weight | Tracking |
|---|---|---|---|---|---|---|
| display- |
22pxDerived(22px = type(display- |
28pxDerived(28px = type(display- |
20pxDerived(20px = type(display- |
26pxDerived(26px = type(display- |
500 | -0.02em |
| heading- |
15pxDerived(15px = type(heading- |
22pxDerived(22px = type(heading- |
17pxDerived(17px = type(heading- |
24pxDerived(24px = type(heading- |
500 | -0.01em |
| heading- |
13pxDerived(13px = type(heading- |
20pxDerived(20px = type(heading- |
15pxDerived(15px = type(heading- |
22pxDerived(22px = type(heading- |
500 | -0.01em |
| heading- |
12pxDerived(12px = type(heading- |
18pxDerived(18px = type(heading- |
13pxDerived(13px = type(heading- |
20pxDerived(20px = type(heading- |
500 | -0.005em |
| body- |
15pxDerived(15px = type(body- |
22pxDerived(22px = type(body- |
17pxDerived(17px = type(body- |
24pxDerived(24px = type(body- |
400 | 0 |
| body- |
13pxDerived(13px = type(body- |
20pxDerived(20px = type(body- |
15pxDerived(15px = type(body- |
22pxDerived(22px = type(body- |
400 | -0.01em |
| body- |
12pxDerived(12px = type(body- |
18pxDerived(18px = type(body- |
13pxDerived(13px = type(body- |
20pxDerived(20px = type(body- |
400 | -0.005em |
| body- |
11pxDerived(11px = type(body- |
14pxDerived(14px = type(body- |
12pxDerived(12px = type(body- |
16pxDerived(16px = type(body- |
400 | 0 |
| button- |
12pxDerived(12px = type(button- |
16pxDerived(16px = type(button- |
15pxDerived(15px = type(button- |
22pxDerived(22px = type(button- |
500 | 0 |
| chip- |
12pxDerived(12px = type(chip- |
16pxDerived(16px = type(chip- |
12pxDerived(12px = type(chip- |
16pxDerived(16px = type(chip- |
500 | 0 |
| input- |
13pxDerived(13px = type(input- |
20pxDerived(20px = type(input- |
15pxDerived(15px = type(input- |
22pxDerived(22px = type(input- |
500 | 0 |
| input- |
13pxDerived(13px = type(input- |
20pxDerived(20px = type(input- |
16pxDerived(16px = type(input- |
22pxDerived(22px = type(input- |
400 | 0 |
Breakpoints
| Name | Expression | Mechanism |
|---|---|---|
| Admin mobile | (max- |
Biến type.$admin- |
Composed values
| Element | Surface | Light | Dark | Fallback |
|---|---|---|---|---|
| Admin display- |
Admin | 1.375remDerived(1.375rem = type(display- |
Same type role | Không khai báo |
| Admin heading- |
Admin | 0.9375remDerived(0.9375rem = type(heading- |
Same type role | Không khai báo |
| Admin heading- |
Admin | 0.8125remDerived(0.8125rem = type(heading- |
Same type role | Không khai báo |
| Admin heading- |
Admin | 0.75remDerived(0.75rem = type(heading- |
Same type role | Không khai báo |
| Admin body- |
Admin | 0.9375remDerived(0.9375rem = type(body- |
Same type role | Không khai báo |
| Admin body- |
Admin | 0.8125remDerived(0.8125rem = type(body- |
Same type role | Không khai báo |
| Admin body- |
Admin | 0.75remDerived(0.75rem = type(body- |
Same type role | Không khai báo |
| Admin body- |
Admin | 0.6875remDerived(0.6875rem = type(body- |
Same type role | Không khai báo |
| Admin button- |
Admin | 0.75remDerived(0.75rem = type(button- |
Same type role | Không khai báo |
| Admin chip- |
Admin | 0.75remDerived(0.75rem = type(chip- |
Same type role | Không khai báo |
| Admin input- |
Admin | 0.8125remDerived(0.8125rem = type(input- |
Same type role | Không khai báo |
| Admin input- |
Admin | 0.8125remDerived(0.8125rem = type(input- |
Same type role | Không khai báo |
| Admin display- |
Admin | 1.25remDerived(1.25rem = type(display- |
Same type role | Không khai báo |
| Admin heading- |
Admin | 1.0625remDerived(1.0625rem = type(heading- |
Same type role | Không khai báo |
| Admin heading- |
Admin | 0.9375remDerived(0.9375rem = type(heading- |
Same type role | Không khai báo |
| Admin heading- |
Admin | 0.8125remDerived(0.8125rem = type(heading- |
Same type role | Không khai báo |
| Admin body- |
Admin | 1.0625remDerived(1.0625rem = type(body- |
Same type role | Không khai báo |
| Admin body- |
Admin | 0.9375remDerived(0.9375rem = type(body- |
Same type role | Không khai báo |
| Admin body- |
Admin | 0.8125remDerived(0.8125rem = type(body- |
Same type role | Không khai báo |
| Admin body- |
Admin | 0.75remDerived(0.75rem = type(body- |
Same type role | Không khai báo |
| Admin button- |
Admin | 0.9375remDerived(0.9375rem = type(button- |
Same type role | Không khai báo |
| Admin chip- |
Admin | 0.75remDerived(0.75rem = type(chip- |
Same type role | Không khai báo |
| Admin input- |
Admin | 0.9375remDerived(0.9375rem = type(input- |
Same type role | Không khai báo |
| Admin input- |
Admin | 1remDerived(1rem = type(input- |
Same type role | Không khai báo |
| Merchant font stack | AI Mode | var(-, - |
Same type role | Không khai báo |
| System font stack | Classic | - |
Same type role | Không khai báo |
Mẫu từng role theo token Classic.
Show code
import React from 'react';
import {Typography} from '@avada/chatty-ui/components/typography.js';
const roleNames = ['display-small', 'heading-large', 'heading-medium', 'heading-small', 'body-large', 'body-medium', 'body-small', 'body-x-small', 'button-label', 'chip-label', 'input-label', 'input-value'];
const variants = {
'display-small': 'h1',
'heading-large': 'h4',
'heading-medium': 'h6',
'body-large': 'body1',
'body-medium': 'body2',
'body-small': 'caption',
'button-label': 'button'
};
export function Roles({surface}) {
return (
<table className="role-list">
<thead>
<tr>
<th>Role</th>
<th>Live example</th>
</tr>
</thead>
<tbody>
{roleNames.map(name => (
<tr className="role-row" key={name}>
<td>
<code>{name}</code>
</td>
<td>
{surface === 'ai-mode' || !variants[name] ? (
<span data-role={name} className={`chatty-type-${name}`}>
Chọn điều phù hợp với bạn
</span>
) : (
<Typography
component="span"
variant={variants[name]}
className={`chatty-type-${name}`}
data-role={name}
>
Chọn điều phù hợp với bạn
</Typography>
)}
</td>
</tr>
))}
</tbody>
</table>
);
}Mẫu từng role theo token AI Mode.
Show code
import React from 'react';
import {Typography} from '@avada/chatty-ui/components/typography.js';
const roleNames = ['display-small', 'heading-large', 'heading-medium', 'heading-small', 'body-large', 'body-medium', 'body-small', 'body-x-small', 'button-label', 'chip-label', 'input-label', 'input-value'];
const variants = {
'display-small': 'h1',
'heading-large': 'h4',
'heading-medium': 'h6',
'body-large': 'body1',
'body-medium': 'body2',
'body-small': 'caption',
'button-label': 'button'
};
export function Roles({surface}) {
return (
<table className="role-list">
<thead>
<tr>
<th>Role</th>
<th>Live example</th>
</tr>
</thead>
<tbody>
{roleNames.map(name => (
<tr className="role-row" key={name}>
<td>
<code>{name}</code>
</td>
<td>
{surface === 'ai-mode' || !variants[name] ? (
<span data-role={name} className={`chatty-type-${name}`}>
Chọn điều phù hợp với bạn
</span>
) : (
<Typography
component="span"
variant={variants[name]}
className={`chatty-type-${name}`}
data-role={name}
>
Chọn điều phù hợp với bạn
</Typography>
)}
</td>
</tr>
))}
</tbody>
</table>
);
}Mẫu từng role theo token Admin (rem).
Show code
import React from 'react';
import {Typography} from '@avada/chatty-ui/components/typography.js';
const roleNames = ['display-small', 'heading-large', 'heading-medium', 'heading-small', 'body-large', 'body-medium', 'body-small', 'body-x-small', 'button-label', 'chip-label', 'input-label', 'input-value'];
const variants = {
'display-small': 'h1',
'heading-large': 'h4',
'heading-medium': 'h6',
'body-large': 'body1',
'body-medium': 'body2',
'body-small': 'caption',
'button-label': 'button'
};
export function Roles({surface}) {
return (
<table className="role-list">
<thead>
<tr>
<th>Role</th>
<th>Live example</th>
</tr>
</thead>
<tbody>
{roleNames.map(name => (
<tr className="role-row" key={name}>
<td>
<code>{name}</code>
</td>
<td>
{surface === 'ai-mode' || !variants[name] ? (
<span data-role={name} className={`chatty-type-${name}`}>
Chọn điều phù hợp với bạn
</span>
) : (
<Typography
component="span"
variant={variants[name]}
className={`chatty-type-${name}`}
data-role={name}
>
Chọn điều phù hợp với bạn
</Typography>
)}
</td>
</tr>
))}
</tbody>
</table>
);
}Copy-paste export
Classic
.Avada-Faqs_Popup {
--chatty-type-display-small-size: 24px;
--chatty-type-display-small-line: 30px;
--chatty-type-display-small-weight: 500;
--chatty-type-display-small-tracking: 0;
--chatty-type-heading-large-size: 17px;
--chatty-type-heading-large-line: 24px;
--chatty-type-heading-large-weight: 600;
--chatty-type-heading-large-tracking: 0;
--chatty-type-heading-medium-size: 15px;
--chatty-type-heading-medium-line: 22px;
--chatty-type-heading-medium-weight: 600;
--chatty-type-heading-medium-tracking: 0;
--chatty-type-heading-small-size: 14px;
--chatty-type-heading-small-line: 20px;
--chatty-type-heading-small-weight: 600;
--chatty-type-heading-small-tracking: 0;
--chatty-type-body-large-size: 17px;
--chatty-type-body-large-line: 24px;
--chatty-type-body-large-weight: 400;
--chatty-type-body-large-tracking: 0;
--chatty-type-body-medium-size: 15px;
--chatty-type-body-medium-line: 22px;
--chatty-type-body-medium-weight: 400;
--chatty-type-body-medium-tracking: 0;
--chatty-type-body-small-size: 14px;
--chatty-type-body-small-line: 20px;
--chatty-type-body-small-weight: 400;
--chatty-type-body-small-tracking: 0;
--chatty-type-body-x-small-size: 13px;
--chatty-type-body-x-small-line: 16px;
--chatty-type-body-x-small-weight: 600;
--chatty-type-body-x-small-tracking: 0;
--chatty-type-button-label-size: 14px;
--chatty-type-button-label-line: 18px;
--chatty-type-button-label-weight: 500;
--chatty-type-button-label-tracking: 0;
--chatty-type-chip-label-size: 14px;
--chatty-type-chip-label-line: 18px;
--chatty-type-chip-label-weight: 500;
--chatty-type-chip-label-tracking: 0;
--chatty-type-input-label-size: 15px;
--chatty-type-input-label-line: 22px;
--chatty-type-input-label-weight: 500;
--chatty-type-input-label-tracking: 0;
--chatty-type-input-value-size: 15px;
--chatty-type-input-value-line: 22px;
--chatty-type-input-value-weight: 400;
--chatty-type-input-value-tracking: 0;
}
.Avada-Faqs_Popup.mobile {
--chatty-type-display-small-size: 22px;
--chatty-type-display-small-line: 28px;
--chatty-type-heading-large-size: 19px;
--chatty-type-heading-large-line: 26px;
--chatty-type-heading-medium-size: 17px;
--chatty-type-heading-medium-line: 24px;
--chatty-type-heading-small-size: 15px;
--chatty-type-heading-small-line: 22px;
--chatty-type-body-large-size: 19px;
--chatty-type-body-large-line: 26px;
--chatty-type-body-medium-size: 17px;
--chatty-type-body-medium-line: 24px;
--chatty-type-body-small-size: 15px;
--chatty-type-body-small-line: 22px;
--chatty-type-body-x-small-size: 14px;
--chatty-type-body-x-small-line: 18px;
--chatty-type-button-label-size: 17px;
--chatty-type-button-label-line: 24px;
--chatty-type-chip-label-size: 14px;
--chatty-type-chip-label-line: 18px;
--chatty-type-input-label-size: 17px;
--chatty-type-input-label-line: 24px;
--chatty-type-input-value-size: 18px;
--chatty-type-input-value-line: 24px;
}
AI Mode
.chatty-ai-mode {
--chatty-type-display-small-size: 24px;
--chatty-type-display-small-line: 30px;
--chatty-type-display-small-weight: 500;
--chatty-type-display-small-tracking: 0;
--chatty-type-heading-large-size: 17px;
--chatty-type-heading-large-line: 24px;
--chatty-type-heading-large-weight: 600;
--chatty-type-heading-large-tracking: 0;
--chatty-type-heading-medium-size: 15px;
--chatty-type-heading-medium-line: 22px;
--chatty-type-heading-medium-weight: 600;
--chatty-type-heading-medium-tracking: 0;
--chatty-type-heading-small-size: 14px;
--chatty-type-heading-small-line: 20px;
--chatty-type-heading-small-weight: 600;
--chatty-type-heading-small-tracking: 0;
--chatty-type-body-large-size: 17px;
--chatty-type-body-large-line: 24px;
--chatty-type-body-large-weight: 400;
--chatty-type-body-large-tracking: 0;
--chatty-type-body-medium-size: 15px;
--chatty-type-body-medium-line: 22px;
--chatty-type-body-medium-weight: 400;
--chatty-type-body-medium-tracking: 0;
--chatty-type-body-small-size: 14px;
--chatty-type-body-small-line: 20px;
--chatty-type-body-small-weight: 400;
--chatty-type-body-small-tracking: 0;
--chatty-type-body-x-small-size: 13px;
--chatty-type-body-x-small-line: 16px;
--chatty-type-body-x-small-weight: 600;
--chatty-type-body-x-small-tracking: 0;
--chatty-type-button-label-size: 14px;
--chatty-type-button-label-line: 18px;
--chatty-type-button-label-weight: 500;
--chatty-type-button-label-tracking: 0;
--chatty-type-chip-label-size: 14px;
--chatty-type-chip-label-line: 18px;
--chatty-type-chip-label-weight: 500;
--chatty-type-chip-label-tracking: 0;
--chatty-type-input-label-size: 15px;
--chatty-type-input-label-line: 22px;
--chatty-type-input-label-weight: 500;
--chatty-type-input-label-tracking: 0;
--chatty-type-input-value-size: 15px;
--chatty-type-input-value-line: 22px;
--chatty-type-input-value-weight: 400;
--chatty-type-input-value-tracking: 0;
}
.chatty-ai-mode.is-mobile {
--chatty-type-display-small-size: 22px;
--chatty-type-display-small-line: 28px;
--chatty-type-heading-large-size: 19px;
--chatty-type-heading-large-line: 26px;
--chatty-type-heading-medium-size: 17px;
--chatty-type-heading-medium-line: 24px;
--chatty-type-heading-small-size: 15px;
--chatty-type-heading-small-line: 22px;
--chatty-type-body-large-size: 19px;
--chatty-type-body-large-line: 26px;
--chatty-type-body-medium-size: 17px;
--chatty-type-body-medium-line: 24px;
--chatty-type-body-small-size: 15px;
--chatty-type-body-small-line: 22px;
--chatty-type-body-x-small-size: 14px;
--chatty-type-body-x-small-line: 18px;
--chatty-type-button-label-size: 17px;
--chatty-type-button-label-line: 24px;
--chatty-type-chip-label-size: 14px;
--chatty-type-chip-label-line: 18px;
--chatty-type-input-label-size: 17px;
--chatty-type-input-label-line: 24px;
--chatty-type-input-value-size: 18px;
--chatty-type-input-value-line: 24px;
}
Admin
.inbox-v2 {
--chatty-type-display-small-size: 1.375rem;
--chatty-type-display-small-line: 1.75rem;
--chatty-type-display-small-weight: 500;
--chatty-type-display-small-tracking: -0.02em;
--chatty-type-heading-large-size: 0.9375rem;
--chatty-type-heading-large-line: 1.375rem;
--chatty-type-heading-large-weight: 500;
--chatty-type-heading-large-tracking: -0.01em;
--chatty-type-heading-medium-size: 0.8125rem;
--chatty-type-heading-medium-line: 1.25rem;
--chatty-type-heading-medium-weight: 500;
--chatty-type-heading-medium-tracking: -0.01em;
--chatty-type-heading-small-size: 0.75rem;
--chatty-type-heading-small-line: 1.125rem;
--chatty-type-heading-small-weight: 500;
--chatty-type-heading-small-tracking: -0.005em;
--chatty-type-body-large-size: 0.9375rem;
--chatty-type-body-large-line: 1.375rem;
--chatty-type-body-large-weight: 400;
--chatty-type-body-large-tracking: 0;
--chatty-type-body-medium-size: 0.8125rem;
--chatty-type-body-medium-line: 1.25rem;
--chatty-type-body-medium-weight: 400;
--chatty-type-body-medium-tracking: -0.01em;
--chatty-type-body-small-size: 0.75rem;
--chatty-type-body-small-line: 1.125rem;
--chatty-type-body-small-weight: 400;
--chatty-type-body-small-tracking: -0.005em;
--chatty-type-body-x-small-size: 0.6875rem;
--chatty-type-body-x-small-line: 0.875rem;
--chatty-type-body-x-small-weight: 400;
--chatty-type-body-x-small-tracking: 0;
--chatty-type-button-label-size: 0.75rem;
--chatty-type-button-label-line: 1rem;
--chatty-type-button-label-weight: 500;
--chatty-type-button-label-tracking: 0;
--chatty-type-chip-label-size: 0.75rem;
--chatty-type-chip-label-line: 1rem;
--chatty-type-chip-label-weight: 500;
--chatty-type-chip-label-tracking: 0;
--chatty-type-input-label-size: 0.8125rem;
--chatty-type-input-label-line: 1.25rem;
--chatty-type-input-label-weight: 500;
--chatty-type-input-label-tracking: 0;
--chatty-type-input-value-size: 0.8125rem;
--chatty-type-input-value-line: 1.25rem;
--chatty-type-input-value-weight: 400;
--chatty-type-input-value-tracking: 0;
}
@media (max-width: 47.9975em) {
.inbox-v2 {
--chatty-type-display-small-size: 1.25rem;
--chatty-type-display-small-line: 1.625rem;
--chatty-type-heading-large-size: 1.0625rem;
--chatty-type-heading-large-line: 1.5rem;
--chatty-type-heading-medium-size: 0.9375rem;
--chatty-type-heading-medium-line: 1.375rem;
--chatty-type-heading-small-size: 0.8125rem;
--chatty-type-heading-small-line: 1.25rem;
--chatty-type-body-large-size: 1.0625rem;
--chatty-type-body-large-line: 1.5rem;
--chatty-type-body-medium-size: 0.9375rem;
--chatty-type-body-medium-line: 1.375rem;
--chatty-type-body-small-size: 0.8125rem;
--chatty-type-body-small-line: 1.25rem;
--chatty-type-body-x-small-size: 0.75rem;
--chatty-type-body-x-small-line: 1rem;
--chatty-type-button-label-size: 0.9375rem;
--chatty-type-button-label-line: 1.375rem;
--chatty-type-chip-label-size: 0.75rem;
--chatty-type-chip-label-line: 1rem;
--chatty-type-input-label-size: 0.9375rem;
--chatty-type-input-label-line: 1.375rem;
--chatty-type-input-value-size: 1rem;
--chatty-type-input-value-line: 1.375rem;
}
}
Contrast matrix
| Surface | Pair | Light ratio | Dark ratio |
|---|---|---|---|
| Classic | - |
4.76:1Measured(#64748b / #ffffff = 4.76:1) | Merchant-- / - |
| AI Mode | - |
6.19:1Measured(#616161 / #ffffff = 6.19:1) | 10.42:1Measured(rgba(255, 255, 255, 0.74) / #131215 = 10.42:1) |
| Admin | - |
5.70:1Measured(#005bd3 / #f7f7f7 = 5.70:1) | No Dark skin |
Target
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 Type() {
return <Target><p>ShopifyInter · stylesheet CDN Shopify · cùng token standalone/embedded</p><div style={{'--chatty-type-weight-regular':400,'--chatty-type-weight-medium':500,'--chatty-type-weight-semibold':600,'--chatty-type-family':'ShopifyInter, ui-sans-serif, system-ui, sans-serif'}}>{['regular','medium','semibold'].map((role,i)=><p data-weight={role} key={role} style={{fontWeight:`var(--chatty-type-weight-${role})`,fontFamily:'var(--chatty-type-family)'}}>{role} · {[400,500,600][i]} · Inbox text</p>)}<span data-badge-label style={{...box,display:'inline-flex',height:20,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)'}}>badge-label · 12/18 · 500</span><p style={{fontSize:11,lineHeight:'14px'}}>body-x-small · 11/14 · chỉ badge đếm số: 3</p></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>;
}