@beehexa/design-rules 2611.4.1 → 2611.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/catalog.json +602 -248
- package/dist/docs/public/_redirects +2 -0
- package/dist/docs/scripts/token-utils.d.mts +5 -1
- package/dist/docs/scripts/token-utils.mjs +28 -3
- package/dist/docs/src/brand/structure-proposal.md +1 -1
- package/dist/docs/src/components/ColorDemo.astro +52 -14
- package/dist/docs/src/components/MotionDemo.astro +135 -0
- package/dist/docs/src/components/NativeControlsDemo.astro +279 -0
- package/dist/docs/src/components/OpacityDemo.astro +8 -8
- package/dist/docs/src/components/RoleGuides.astro +2 -2
- package/dist/docs/src/components/ShapeDemo.astro +78 -35
- package/dist/docs/src/components/SiteHeader.astro +19 -4
- package/dist/docs/src/components/SystemAreas.astro +1 -1
- package/dist/docs/src/components/TokenTable.astro +16 -1
- package/dist/docs/src/components/TypeDemo.astro +15 -15
- package/dist/docs/src/components/ZIndexDemo.astro +1 -1
- package/dist/docs/src/components/logos/LogoInUse.astro +3 -3
- package/dist/docs/src/content/components/button/accessibility.mdx +41 -8
- package/dist/docs/src/content/components/button/code.mdx +8 -1
- package/dist/docs/src/content/components/button/examples.mdx +23 -4
- package/dist/docs/src/content/components/button/usage.mdx +26 -0
- package/dist/docs/src/content/components/resizable-panel/accessibility.mdx +61 -0
- package/dist/docs/src/content/components/resizable-panel/changelog.mdx +20 -0
- package/dist/docs/src/content/components/resizable-panel/code.mdx +79 -0
- package/dist/docs/src/content/components/resizable-panel/examples.mdx +85 -0
- package/dist/docs/src/content/components/resizable-panel/meta.json +5 -0
- package/dist/docs/src/content/components/resizable-panel/usage.mdx +101 -0
- package/dist/docs/src/content/foundations/guidelines/accessibility/keyboard-and-focus.mdx +75 -0
- package/dist/docs/src/content/foundations/guidelines/accessibility/statement.mdx +45 -0
- package/dist/docs/src/content/foundations/guidelines/accessibility/testing.mdx +58 -0
- package/dist/docs/src/content/foundations/guidelines/accessibility.mdx +100 -11
- package/dist/docs/src/content/foundations/guidelines/content.mdx +11 -2
- package/dist/docs/src/content/foundations/index.mdx +3 -3
- package/dist/docs/src/content/foundations/styles/border.mdx +10 -3
- package/dist/docs/src/content/foundations/styles/color/accessibility.mdx +4 -2
- package/dist/docs/src/content/foundations/styles/color/dark-mode.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/color/index.mdx +14 -2
- package/dist/docs/src/content/foundations/styles/color/palette.mdx +4 -4
- package/dist/docs/src/content/foundations/styles/color/tokens.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/color/usage.mdx +25 -3
- package/dist/docs/src/content/foundations/styles/data-visualization.mdx +76 -0
- package/dist/docs/src/content/foundations/styles/elevation.mdx +7 -1
- package/dist/docs/src/content/foundations/styles/icons/accessibility.mdx +1 -1
- package/dist/docs/src/content/foundations/styles/icons/code.mdx +6 -18
- package/dist/docs/src/content/foundations/styles/icons/index.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/icons/usage.mdx +4 -2
- package/dist/docs/src/content/foundations/styles/interaction-states.mdx +82 -9
- package/dist/docs/src/content/foundations/styles/layout/app-frame.mdx +2 -4
- package/dist/docs/src/content/foundations/styles/layout/breakpoints.mdx +10 -7
- package/dist/docs/src/content/foundations/styles/layout/grid.mdx +4 -2
- package/dist/docs/src/content/foundations/styles/layout/index.mdx +3 -3
- package/dist/docs/src/content/foundations/styles/layout/overlays.mdx +28 -37
- package/dist/docs/src/content/foundations/styles/layout/page-widths.mdx +4 -4
- package/dist/docs/src/content/foundations/styles/logos/downloads-and-terms.mdx +7 -7
- package/dist/docs/src/content/foundations/styles/logos/index.mdx +13 -2
- package/dist/docs/src/content/foundations/styles/logos/placement-and-containers.mdx +4 -2
- package/dist/docs/src/content/foundations/styles/logos/product-logos.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/logos/using-the-logo.mdx +3 -1
- package/dist/docs/src/content/foundations/styles/motion.mdx +131 -3
- package/dist/docs/src/content/foundations/styles/opacity.mdx +7 -1
- package/dist/docs/src/content/foundations/styles/radius.mdx +63 -15
- package/dist/docs/src/content/foundations/styles/scrollbars.mdx +176 -0
- package/dist/docs/src/content/foundations/styles/size-and-density.mdx +16 -6
- package/dist/docs/src/content/foundations/styles/spacing.mdx +17 -3
- package/dist/docs/src/content/foundations/styles/typography/code.mdx +4 -2
- package/dist/docs/src/content/foundations/styles/typography/index.mdx +13 -3
- package/dist/docs/src/content/foundations/styles/typography/usage.mdx +5 -3
- package/dist/docs/src/content/foundations/styles/typography/vietnamese.mdx +2 -2
- package/dist/docs/src/content/foundations/styles/z-index.mdx +4 -0
- package/dist/docs/src/content/foundations/tokens/all-tokens.mdx +11 -0
- package/dist/docs/src/content/foundations/tokens/index.mdx +17 -9
- package/dist/docs/src/content/get-started/design.mdx +1 -1
- package/dist/docs/src/content/get-started/develop.mdx +2 -6
- package/dist/docs/src/content/get-started/index.mdx +1 -1
- package/dist/docs/src/content/release-phases/index.mdx +1 -1
- package/dist/docs/src/content/tools/ant-design-vue-theme.mdx +474 -12
- package/dist/docs/src/content/tools/application-content.mdx +166 -32
- package/dist/docs/src/content/tools/editors.mdx +247 -3
- package/dist/docs/src/content/tools/eslint.mdx +1 -1
- package/dist/docs/src/content/tools/index.mdx +2 -2
- package/dist/docs/src/content/tools/mermaid.mdx +108 -13
- package/dist/docs/src/content/tools/vueflow.mdx +58 -0
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility/keyboard-and-focus.mdx +75 -0
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility/statement.mdx +45 -0
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility/testing.mdx +58 -0
- package/dist/docs/src/content-vi/foundations/guidelines/accessibility.mdx +108 -0
- package/dist/docs/src/content-vi/foundations/guidelines/content.mdx +34 -0
- package/dist/docs/src/content-vi/foundations/index.mdx +9 -0
- package/dist/docs/src/content-vi/foundations/styles/border.mdx +9 -3
- package/dist/docs/src/content-vi/foundations/styles/color/accessibility.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/styles/color/dark-mode.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/color/index.mdx +14 -2
- package/dist/docs/src/content-vi/foundations/styles/color/palette.mdx +5 -5
- package/dist/docs/src/content-vi/foundations/styles/color/tokens.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/color/usage.mdx +24 -2
- package/dist/docs/src/content-vi/foundations/styles/elevation.mdx +7 -1
- package/dist/docs/src/content-vi/foundations/styles/icons/accessibility.mdx +1 -1
- package/dist/docs/src/content-vi/foundations/styles/icons/code.mdx +6 -18
- package/dist/docs/src/content-vi/foundations/styles/icons/index.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/icons/usage.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/styles/interaction-states.mdx +22 -8
- package/dist/docs/src/content-vi/foundations/styles/layout/app-frame.mdx +3 -1
- package/dist/docs/src/content-vi/foundations/styles/layout/breakpoints.mdx +10 -7
- package/dist/docs/src/content-vi/foundations/styles/layout/grid.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/styles/layout/index.mdx +3 -3
- package/dist/docs/src/content-vi/foundations/styles/layout/overlays.mdx +36 -0
- package/dist/docs/src/content-vi/foundations/styles/layout/page-widths.mdx +5 -1
- package/dist/docs/src/content-vi/foundations/styles/logos/downloads-and-terms.mdx +7 -7
- package/dist/docs/src/content-vi/foundations/styles/logos/index.mdx +13 -2
- package/dist/docs/src/content-vi/foundations/styles/logos/placement-and-containers.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/styles/logos/product-logos.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/logos/using-the-logo.mdx +3 -1
- package/dist/docs/src/content-vi/foundations/styles/motion.mdx +139 -0
- package/dist/docs/src/content-vi/foundations/styles/opacity.mdx +8 -2
- package/dist/docs/src/content-vi/foundations/styles/radius.mdx +63 -15
- package/dist/docs/src/content-vi/foundations/styles/size-and-density.mdx +16 -6
- package/dist/docs/src/content-vi/foundations/styles/spacing.mdx +17 -3
- package/dist/docs/src/content-vi/foundations/styles/typography/code.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/styles/typography/index.mdx +14 -4
- package/dist/docs/src/content-vi/foundations/styles/typography/usage.mdx +4 -2
- package/dist/docs/src/content-vi/foundations/styles/typography/vietnamese.mdx +2 -2
- package/dist/docs/src/content-vi/foundations/styles/z-index.mdx +4 -0
- package/dist/docs/src/content-vi/foundations/tokens/all-tokens.mdx +47 -0
- package/dist/docs/src/content-vi/foundations/tokens/index.mdx +35 -0
- package/dist/docs/src/lib/i18n.ts +0 -1
- package/dist/docs/src/lib/token-descriptions-vi.ts +60 -9
- package/dist/docs/src/lib/tokens.ts +3 -0
- package/dist/docs/src/styles/chrome.css +10 -3
- package/dist/docs/src/styles/color.css +33 -23
- package/dist/docs/src/styles/docs.css +26 -28
- package/dist/docs/src/styles/elevation.css +4 -4
- package/dist/docs/src/styles/global.css +21 -1
- package/dist/docs/src/styles/icons.css +10 -9
- package/dist/docs/src/styles/kit.css +36 -32
- package/dist/docs/src/styles/layout.css +7 -7
- package/dist/docs/src/styles/motion.css +34 -0
- package/dist/docs/src/styles/opacity.css +3 -3
- package/dist/docs/src/styles/scrollbars.css +74 -0
- package/dist/docs/src/styles/shapes.css +21 -11
- package/dist/docs/src/styles/tokens.css +392 -12
- package/dist/docs/src/styles/tokens.js +185 -6
- package/dist/docs/src/styles/typography.css +4 -4
- package/dist/docs/src/styles/zindex.css +10 -7
- package/dist/docs/tokens/color.json +18 -1
- package/dist/docs/tokens/content.json +8 -3
- package/dist/docs/tokens/diagram.json +9 -3
- package/dist/docs/tokens/flow.json +2 -2
- package/dist/docs/tokens/layout.json +4 -0
- package/dist/docs/tokens/motion.json +37 -5
- package/dist/docs/tokens/radius.json +52 -8
- package/dist/docs/tokens/resize.json +12 -0
- package/dist/docs/tokens/scrollbar.json +40 -0
- package/dist/docs/tokens/size.json +1 -1
- package/dist/docs/tokens/spacing.json +31 -1
- package/dist/docs/tokens/switch.json +280 -0
- package/dist/index.js +602 -248
- package/package.json +1 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Spacing
|
|
3
|
-
description:
|
|
3
|
+
description: Space shows what belongs together. A 14-step scale on an 8 px base gives every gap, padding and margin a reason.
|
|
4
4
|
order: 3
|
|
5
5
|
---
|
|
6
6
|
import SpacingDemo from '../../../components/SpacingDemo.astro';
|
|
7
|
+
import TokenTable from '../../../components/TokenTable.astro';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
Things that belong together sit close; separate groups sit further apart. People see the groups before they read a word, so good spacing does half the work of a heading.
|
|
9
10
|
|
|
10
|
-
|
|
11
|
+
**Every space is a spacing token. Pick the step by how closely two things belong together.**
|
|
11
12
|
|
|
12
13
|
<SpacingDemo kind="anatomy" />
|
|
13
14
|
|
|
@@ -63,6 +64,19 @@ Vietnamese text needs taller lines for its accents. The text styles add that hei
|
|
|
63
64
|
|
|
64
65
|
Vietnamese labels are often longer than English ones. Let them wrap, or give the container room. Do not take space away to make a label fit.
|
|
65
66
|
|
|
67
|
+
## Tokens
|
|
68
|
+
|
|
69
|
+
Most spacing comes from a token named after the kind of element, not from the scale. A family token points to a step of the scale, so every element of that kind changes together. Take a step from the scale only when no family covers the case.
|
|
70
|
+
|
|
71
|
+
- **Controls:** `space.control.x` (and `.small`, `.large`) beside the label, `space.control.gap` between icon and label.
|
|
72
|
+
- **Items:** `space.item.x` in menus, lists and side navigation.
|
|
73
|
+
- **Overlays:** `space.overlay` inside menus and popovers, `space.overlay.offset` from the element that opened them.
|
|
74
|
+
- **Cards and dialogs:** `space.card`, `space.modal` and `space.modal.gap`.
|
|
75
|
+
- **Tables:** `space.table.cell.x` and `space.table.cell.y`.
|
|
76
|
+
- **Columns:** `space.stack` between fields, list items and cards; `space.stack.group` between groups.
|
|
77
|
+
|
|
78
|
+
<TokenTable prefix="space" only="family" />
|
|
79
|
+
|
|
66
80
|
## Related
|
|
67
81
|
|
|
68
82
|
- [App frame](/foundations/styles/layout/app-frame/): the spacing that lines up the header, side navigation and page header.
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Code
|
|
3
|
-
description:
|
|
3
|
+
description: Load the fonts, use the type tokens and turn on the OpenType features that keep order numbers and codes easy to read.
|
|
4
4
|
order: 3
|
|
5
5
|
---
|
|
6
6
|
import TokenTable from '../../../../components/TokenTable.astro';
|
|
7
7
|
import TypeDemo from '../../../../components/TypeDemo.astro';
|
|
8
8
|
|
|
9
|
+
Everything you need to set Beehexa type in code. Use the tokens, and the fonts, fallbacks and features come with them.
|
|
10
|
+
|
|
9
11
|
## Font stacks
|
|
10
12
|
|
|
11
13
|
Use the tokens, not your own lists.
|
|
@@ -18,7 +20,7 @@ font-family: Inter, "Noto Sans", system-ui, sans-serif;
|
|
|
18
20
|
font-family: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
19
21
|
```
|
|
20
22
|
|
|
21
|
-
Noto Sans is the fallback because it covers Vietnamese and ₫ and is
|
|
23
|
+
Noto Sans is the fallback because it covers Vietnamese and ₫ and is almost the same size as Inter, so a page that falls back keeps its layout.
|
|
22
24
|
|
|
23
25
|
## Getting the fonts
|
|
24
26
|
|
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Typography
|
|
3
|
-
description: Two typefaces and fourteen text styles
|
|
3
|
+
description: Most of what people do in Beehexa is read. Two typefaces and fourteen text styles keep it clear, in English and in Vietnamese.
|
|
4
4
|
order: 2
|
|
5
5
|
sidebarLabel: Overview
|
|
6
6
|
---
|
|
7
7
|
import TypeDemo from '../../../../components/TypeDemo.astro';
|
|
8
8
|
|
|
9
|
+
Most of what people do in Beehexa is read: order numbers, statuses, error messages, settings. Clear type makes that reading fast and less tiring, in English and in Vietnamese.
|
|
10
|
+
|
|
9
11
|
## Typefaces
|
|
10
12
|
|
|
11
13
|
Two typefaces cover everything: Inter for interface and reading text, JetBrains Mono for code.
|
|
12
14
|
|
|
13
15
|
<TypeDemo kind="faces" />
|
|
14
16
|
|
|
15
|
-
Inter
|
|
17
|
+
Why Inter:
|
|
16
18
|
|
|
17
19
|
- Its tall x-height keeps small interface text legible.
|
|
18
20
|
- It covers Vietnamese in full, the ₫ sign included.
|
|
@@ -43,7 +45,7 @@ Text is set with **text styles**, not loose sizes. Each style is one token that
|
|
|
43
45
|
| 600 | `font.weight.semibold` | Headings |
|
|
44
46
|
| 700 | `font.weight.bold` | Display only |
|
|
45
47
|
|
|
46
|
-
Don't go lighter than 400: thin strokes break up on small text. Bold body text is not a heading; for emphasis that matters to the meaning, use `<strong>` or `<em>`, so
|
|
48
|
+
Don't go lighter than 400: thin strokes break up on small text. Bold body text is not a heading; for emphasis that matters to the meaning, use `<strong>` or `<em>`, so the meaning is in the text itself, not only in how it looks.
|
|
47
49
|
|
|
48
50
|
## Letter spacing
|
|
49
51
|
|
|
@@ -56,3 +58,11 @@ Line heights are part of each text style and sit on the 4 px grid: every one is
|
|
|
56
58
|
- Body and label styles use 1.3–1.5 times the size (14/20, 12/16, 16/24), which leave room between lines of interface text without spreading a paragraph apart.
|
|
57
59
|
- Headings tighten as they grow, to about 1.1–1.25 for display sizes, so large type stays one block.
|
|
58
60
|
- Vietnamese text uses taller values; see [Vietnamese](/foundations/styles/typography/vietnamese/).
|
|
61
|
+
|
|
62
|
+
## In this section
|
|
63
|
+
|
|
64
|
+
| Page | What is in it |
|
|
65
|
+
|---|---|
|
|
66
|
+
| [Usage](/foundations/styles/typography/usage/) | The text style for each part of a screen, hierarchy, readability and long text. |
|
|
67
|
+
| [Vietnamese](/foundations/styles/typography/vietnamese/) | Taller line heights that keep Vietnamese marks whole. |
|
|
68
|
+
| [Code](/foundations/styles/typography/code/) | Font stacks, getting the fonts, OpenType features and the type tokens. |
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Usage
|
|
3
|
-
description: Which text style each part of a screen
|
|
3
|
+
description: Which text style to use for each part of a screen, so headings, labels and body text look the same everywhere.
|
|
4
4
|
order: 1
|
|
5
5
|
---
|
|
6
6
|
import TypeDemo from '../../../../components/TypeDemo.astro';
|
|
7
7
|
|
|
8
|
+
A clear hierarchy lets people scan a page and find what they need before reading a word. Use the same style for the same job, on every screen.
|
|
9
|
+
|
|
8
10
|
## Where each style goes
|
|
9
11
|
|
|
10
12
|
Product UI uses these styles; component pages name the style each part uses. When a part isn't listed, use the style of the nearest one with the same role.
|
|
@@ -103,7 +105,7 @@ In CSS, each style is one `font` declaration:
|
|
|
103
105
|
```
|
|
104
106
|
|
|
105
107
|
- Use a style as a whole. Don't take its size and set your own weight or line height: a near-miss style looks like a mistake next to the real one.
|
|
106
|
-
- Don't make a new style for one screen. If a role is missing, add it
|
|
108
|
+
- Don't make a new style for one screen. If a role is missing, ask the design system team to add it.
|
|
107
109
|
- Set colour separately, with `color.text.*` tokens.
|
|
108
110
|
- Show the selected item, such as the current page or tab, with colour and an indicator bar, not with a heavier weight: a bolder word gets wider and shifts its neighbours.
|
|
109
111
|
- Bold inside text (`<strong>`, `<b>`) is semibold, 600. Weight 700 stays with the display styles.
|
|
@@ -120,7 +122,7 @@ In CSS, each style is one `font` declaration:
|
|
|
120
122
|
|
|
121
123
|
- One page title (`h1`) per page. Go down the heading levels in order, without skipping one.
|
|
122
124
|
- Mark up structure with headings, not with bold or larger paragraphs.
|
|
123
|
-
- Show importance with size and weight first. Don't rely on
|
|
125
|
+
- Show importance with size and weight first. Don't rely on colour alone.
|
|
124
126
|
|
|
125
127
|
## Readability
|
|
126
128
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Vietnamese
|
|
3
|
-
description:
|
|
3
|
+
description: Vietnamese stacks marks above some letters. Taller line heights keep every mark visible and never cut off.
|
|
4
4
|
order: 2
|
|
5
5
|
---
|
|
6
6
|
import TypeDemo from '../../../../components/TypeDemo.astro';
|
|
@@ -37,7 +37,7 @@ Each box below is one line that clips its overflow, with the line box outlined.
|
|
|
37
37
|
<TypeDemo kind="vietnamese" />
|
|
38
38
|
|
|
39
39
|
- **Mark the language.** Set `lang="vi"` on `<html>` for a Vietnamese page, or on the element that holds Vietnamese text. Text marked with another language inside it, such as `lang="en"`, goes back to the English values.
|
|
40
|
-
- **Use the tokens.** The text style tokens switch on their own under `lang="vi"` (`:lang(vi)` in `tokens.css`). Code that can't read CSS variables, such as
|
|
40
|
+
- **Use the tokens.** The text style tokens switch on their own under `lang="vi"` (`:lang(vi)` in `tokens.css`). Code that can't read CSS variables, such as a theme object in JavaScript, takes the `vi` values from `tokens.js`.
|
|
41
41
|
- **Let components grow.** A control or row that sets a fixed height must fit the Vietnamese line height: a 14 px label needs 24 px of line, so set heights from padding plus line height, not as a fixed number.
|
|
42
42
|
- **Don't clip text vertically.** Avoid `overflow: hidden` on a box with no vertical padding; when you must truncate, clip horizontally and let the line box hold the marks.
|
|
43
43
|
- **Test with this string** in every component and state: **ỔN ĐỊNH · ẤN ĐỘ · ẪM · Ở ĐÂY CÓ ƯU ĐÃI**.
|
|
@@ -65,3 +65,7 @@ Root native Modal/Drawer surfaces remain in the document body for viewport geome
|
|
|
65
65
|
Monaco's detached hover, completion and parameter-hint widgets use `z-index.tooltip`. Keep the editor takeover isolated so its child chrome cannot cover global feedback. Use one `color.surface.scrim` behind a modal or image inspector, not multiple translucent layers.
|
|
66
66
|
|
|
67
67
|
Preserve focus containment, focus return, Escape handling and scroll locking. Exercise the actual graph, editor hints, nested menus, inspector and loading stack; numeric ordering alone is not visual or accessibility proof.
|
|
68
|
+
## Related
|
|
69
|
+
|
|
70
|
+
- [Elevation](/foundations/styles/elevation/): how high a surface looks.
|
|
71
|
+
- [Motion](/foundations/styles/motion/): how menus, dialogs and toasts appear and leave.
|
|
@@ -5,6 +5,8 @@ order: 2
|
|
|
5
5
|
---
|
|
6
6
|
import TokenTable from '../../../components/TokenTable.astro';
|
|
7
7
|
|
|
8
|
+
Look up any token here: its name, its value in light and dark, and what it is for. To choose a token, start from the page of its style, such as [Color usage](/foundations/styles/color/usage/) or [Spacing](/foundations/styles/spacing/).
|
|
9
|
+
|
|
8
10
|
## Color
|
|
9
11
|
<TokenTable prefix="color" />
|
|
10
12
|
|
|
@@ -23,14 +25,23 @@ import TokenTable from '../../../components/TokenTable.astro';
|
|
|
23
25
|
## Border
|
|
24
26
|
<TokenTable prefix="border" />
|
|
25
27
|
|
|
28
|
+
## Opacity
|
|
29
|
+
<TokenTable prefix="opacity" />
|
|
30
|
+
|
|
26
31
|
## Elevation
|
|
27
32
|
<TokenTable prefix="elevation" />
|
|
28
33
|
|
|
34
|
+
## Z-index
|
|
35
|
+
<TokenTable prefix="z-index" />
|
|
36
|
+
|
|
29
37
|
## Motion
|
|
30
38
|
<TokenTable prefix="motion" />
|
|
31
39
|
|
|
32
40
|
## Breakpoints
|
|
33
41
|
<TokenTable prefix="breakpoint" />
|
|
34
42
|
|
|
43
|
+
## Layout
|
|
44
|
+
<TokenTable prefix="layout" />
|
|
45
|
+
|
|
35
46
|
## Interaction states
|
|
36
47
|
<TokenTable prefix="state" />
|
|
@@ -1,27 +1,35 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Tokens overview
|
|
3
|
-
description:
|
|
3
|
+
description: "Tokens give every design decision a name, so design and code use the same colours, sizes and spacing."
|
|
4
4
|
order: 1
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
When a designer picks "text subtle" in a design file and a developer writes `var(--bh-color-text-subtle)`, they mean the same grey. That shared name is a design token. Change its value once and every product follows, so screens never drift apart.
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## How tokens are layered
|
|
10
|
+
|
|
11
|
+
Tokens come in three layers. Use the most specific one that fits.
|
|
12
|
+
|
|
13
|
+
| Layer | Example | Use it |
|
|
14
|
+
| --- | --- | --- |
|
|
15
|
+
| Scale | `color.graphite.11`, `space.200`, `radius.100` | The raw steps. Colour scales are never used directly. Spacing and radius steps are used when no role token fits. |
|
|
16
|
+
| Role | `color.text.subtle`, `space.control.x` | In products and components. Each is named for its job, so it stays right when the scale changes. |
|
|
17
|
+
| Component | `color.code.background` | Only where no role fits. |
|
|
18
|
+
|
|
19
|
+
A role token points at a step of a scale, for example `color.text` points at `{color.graphite.12}`. Use the role token in products, not the step it points at.
|
|
10
20
|
|
|
11
21
|
## Naming
|
|
12
22
|
|
|
13
|
-
Tokens are named from general to specific, separated by dots in
|
|
23
|
+
Tokens are named from general to specific, separated by dots in design and documentation, and by hyphens in CSS:
|
|
14
24
|
|
|
15
|
-
|
|
|
25
|
+
| Token | CSS custom property |
|
|
16
26
|
| --- | --- |
|
|
17
27
|
| `color.text` | `--bh-color-text` |
|
|
18
28
|
| `space.200` | `--bh-space-200` |
|
|
19
29
|
| `color.border.focus` | `--bh-color-border-focus` |
|
|
20
30
|
|
|
21
|
-
##
|
|
22
|
-
|
|
23
|
-
Every token has one value, kept in one place. The token tables on this site and the CSS variables in products come from that same source, so they never drift apart.
|
|
31
|
+
## One source
|
|
24
32
|
|
|
25
|
-
|
|
33
|
+
Every token has one value, kept in one place. The token tables on this site and the CSS variables in products come from that same source, so they always match.
|
|
26
34
|
|
|
27
35
|
See [All design tokens](/foundations/tokens/all-tokens/) for the full list.
|
|
@@ -18,7 +18,7 @@ Specify hover, focus, pressed, selected and disabled for every interactive eleme
|
|
|
18
18
|
|
|
19
19
|
## Check accessibility early
|
|
20
20
|
|
|
21
|
-
Beehexa
|
|
21
|
+
Beehexa components are built to WCAG 2.2 AA, and your screen should reach the same level. Read the [accessibility guidelines](/foundations/guidelines/accessibility/) and the Accessibility tab of every component you use.
|
|
22
22
|
|
|
23
23
|
## Check colour before handoff
|
|
24
24
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Develop
|
|
3
|
-
description: How developers use the token CSS, the
|
|
3
|
+
description: How developers use the token CSS, the lint rules and the docs for AI agents.
|
|
4
4
|
order: 2
|
|
5
5
|
---
|
|
6
6
|
|
|
@@ -40,16 +40,12 @@ Tokens ship as CSS custom properties with the `--bh-` prefix:
|
|
|
40
40
|
.panel {
|
|
41
41
|
padding: var(--bh-space-300);
|
|
42
42
|
border: var(--bh-border-width-default) solid var(--bh-color-border);
|
|
43
|
-
border-radius: var(--bh-radius-
|
|
43
|
+
border-radius: var(--bh-radius-100);
|
|
44
44
|
}
|
|
45
45
|
```
|
|
46
46
|
|
|
47
47
|
Do not write raw hex colors, arbitrary sizes or durations. Choose installed tokens by semantic role and read their usage rules. The [Stylelint](/tools/stylelint/) and [ESLint](/tools/eslint/) integrations are planned; their documentation is not proof that enforcement is installed.
|
|
48
48
|
|
|
49
|
-
## Theme Ant Design Vue
|
|
50
|
-
|
|
51
|
-
Beehexa apps are built on Ant Design Vue. Apply the [Beehexa theme](/tools/ant-design-vue-theme/) so its components use the same tokens.
|
|
52
|
-
|
|
53
49
|
## Working with AI agents
|
|
54
50
|
|
|
55
51
|
Start with `@beehexa/design-rules/agent` (installed `dist/AGENTS.md`), then use the package's
|
|
@@ -33,7 +33,7 @@ Use tokens instead of raw values. Tokens ship as CSS custom properties with the
|
|
|
33
33
|
.panel {
|
|
34
34
|
padding: var(--bh-space-300);
|
|
35
35
|
border: var(--bh-border-width-default) solid var(--bh-color-border);
|
|
36
|
-
border-radius: var(--bh-radius-
|
|
36
|
+
border-radius: var(--bh-radius-100);
|
|
37
37
|
}
|
|
38
38
|
```
|
|
39
39
|
|
|
@@ -9,4 +9,4 @@ import PhaseTable from '../../components/PhaseTable.astro';
|
|
|
9
9
|
|
|
10
10
|
<PhaseTable />
|
|
11
11
|
|
|
12
|
-
Every page and component shows its phase in a
|
|
12
|
+
Every page and component shows its phase in a label. When every page in a section shares one phase, the sidebar says so once instead. Changes are recorded in each component's Changelog tab and in [News](/news/).
|