Skip to content

Foundations ​

The @yue-ui/design-tokens package is pure CSS with no build step. It consists of three token layers and one implementation layer, totalling 451 unique token names (568 declarations, including dark and Accent overrides).

Layers and scale ​

LayerFileDeclarationsContents
primitivessrc/primitives.css212Scales, fonts, motion, raw palette
semanticssrc/semantics.css134Theme and interaction roles, Accent
componentssrc/components.css222Component geometry and visual contract
implementationssrc/components/*.css—Prototype-stage component selectors (.btn and others), progressively taken over by @yue-ui/vue

Grouped by token name:

CategoryCount
Raw palette (--neutral-*, --azure-* …)68
Component contracts (--button-*, --input-* …)216
Semantic roles (--surface, --text-*, --border-* …)61
Space / size / radius / stroke36
Font / font size / line height26
Motion / opacity / elevation18
Accent roles18

Four modes ​

The token package supports four forms at once, all switched through data-* attributes or media queries, with no JS branching required:

html
<html data-theme="dark" data-accent="neutral">
  • Light — :root
  • Dark — [data-theme=dark], which also sets color-scheme: dark
  • Accent — [data-accent=neutral] overrides the whole --accent-* set; the default azure needs no attribute
  • Forced colors — under forced-colors: active it preserves hierarchy and state cues (see src/components/box.css, overlay.css)

How to reference it ​

css
/* Application entry: import all tokens at once */
@import '@yue-ui/design-tokens/index.css';
js
// Or let the bundler handle it
import '@yue-ui/design-tokens/index.css'

The package exports two entries, index.css (token layers) and components.css (implementation layer); the layer order is declared by index.css, so tokens must load before component styles.

Design guidelines ​

For color, dark mode, typography, icons, layout and motion principles, see Design guidelines. This page only covers token hierarchy, load order and the CSS API; design decisions are not maintained in a second copy here.

Coming soon ​

  • A token browser (reading the CSS inside the package directly, rather than maintaining a second inventory)