Raft Design System

Foundations

Tokens

Every token group with its values in both modes, how token names are built, where tokens.json lives, how foundation.css and tokens.resolved.json are generated from it, which component sizes the web and the apps share, and how to move off the former names.

A token is a named value: a color, a shadow, a size. Components and products use the name, never the value, so a value can change in one place and every screen follows in both modes. This page is the reference for every token. The rules for choosing between tokens belong to the foundation that owns each group, linked from each section below.

Principles

  • One source. Every token in tokens.json is written once there. foundation.css is generated from it, and nothing else defines a token value.
  • Names say the role, not the color. attention, not pink; layer-canvas, not white. A token keeps its name when its value changes, and the dark value lives under the same name.
  • Use the role token before the palette. Reach for palette-* only where no role fits; see Color.
  • A value used three times becomes a token. A one-off value can stay inline, as an ink step or an oklch() literal; on its third use, add a token.

Where tokens live

FileWhat it holds
packages/ui/src/tokens.jsonThe source for colors, shadows, the focus ring and the metric tokens, in the Design Tokens Community Group format (2025.10). Published as @botiverse/raft-ui/tokens.json for tools outside CSS.
packages/ui/src/foundation.cssGenerated from tokens.json: every token as a CSS custom property, for light mode, dark mode and the system setting. Published as @botiverse/raft-ui/foundation.css for plain CSS.
packages/ui/src/tokens.resolved.jsonGenerated from tokens.json: every numeric token as a plain number in each context, for readers that can't evaluate CSS, such as the iOS and Android apps (Resolved values). Published as @botiverse/raft-ui/tokens.resolved.json.
packages/ui/src/styles.cssThe Tailwind entry. It imports foundation.css, maps tokens to utilities (bg-layer-canvas, text-foreground-muted, shadow-float) and defines the tokens that exist only as Tailwind theme values: radii, type styles and ease-slide.
packages/ui/src/fonts.cssThe font families: Space Grotesk, Space Mono and the CJK fallbacks (Simplified Chinese by default; Traditional Chinese, Japanese and Korean under their lang).

An app that uses Tailwind imports @botiverse/raft-ui/styles.css. A page without Tailwind imports @botiverse/raft-ui/foundation.css and reads the custom properties: var(--layer-canvas).

How foundation.css is generated

packages/ui/scripts/build-tokens.mjs reads tokens.json and writes foundation.css and tokens.resolved.json. Never edit either by hand.

sh
vp run @botiverse/raft-ui#build:tokens          # write src/foundation.css and src/tokens.resolved.json
node packages/ui/scripts/build-tokens.mjs --check   # exit 1 if either is out of date
  • Change a value in tokens.json, run build:tokens, and commit the three files. A test (foundation.generated.test.ts) fails when foundation.css or tokens.resolved.json doesn't match tokens.json.
  • A token's path becomes its property name: {layer.canvas} is --layer-canvas. $root names the group itself: {foreground.$root} is --foreground. A reference ("{palette.cyan.800}") becomes var(--palette-cyan-800).
  • The format has no field for modes, so tokens.json adds an extension, build.botiverse.raft:
FieldMeaning
modes.darkThe dark-mode value. A token without it has the same value in both modes
fineThe value with a mouse or a trackpad at any width, (pointer: fine): a size that follows the input, not the width, such as a list row's least height. A narrow window with a mouse takes it; a desktop takes it too unless the token also has desktop, which wins from 768px. The token's own value is still the phone's and a touch screen's
desktopThe value on a desktop: from 768px, where the desktop layout begins, with a mouse or trackpad (Spacing); the token's own value is then the phone's and a touch screen's. Used by metric tokens such as field-font-size. It wins over fine
wideTouchThe value from 768px by touch, (width >= 48rem) and (pointer: coarse): a tablet, an unfolded foldable, a phone held sideways that wide; the apps' wide touch layout, from 744pt. Only for a size a wide touch screen draws differently from a phone, such as a head's height (artin, #wg-mobile-sync:#265). The token's own value is still the phone's
scope: "root"A value that doesn't change with the mode, such as the palette: declared once on :root
scope: "every-mode"An alias of a token that changes with the mode: declared again in each mode scope, so it resolves against that mode's value
css: trueA value kept as a CSS expression that the format has no type for: color-mix(), a shadow with several layers
static: trueA deprecated alias (in the deprecated group) of a value that doesn't change with the mode

The generated file has, in order:

  1. the palette, on :where(:root);
  2. light mode, on :where(:root) and .light;
  3. dark mode, on .dark;
  4. dark mode again under @media (prefers-color-scheme: dark) for a root without .light or .dark, so the page has the right colors before the app sets a class;
  5. the aliases declared in every mode, then the deprecated names;
  6. the values with a fine pointer, under @media (pointer: fine) (Tailwind's pointer-fine:), on the same selectors as the values they replace;
  7. the desktop values, under @media (width >= 48rem) and (pointer: fine) (the query of the desktop type in styles.css too), on the same selectors as the values they replace. They come after the fine values, so a token's desktop wins over its fine;
  8. the wide touch values, under @media (width >= 48rem) and (pointer: coarse), on the same selectors as the values they replace. The query never matches with the desktop's, so the order between them doesn't matter.

A .light element inside a dark page is a light island, for a preview or a portal; the dark: variant in styles.css follows the nearest mode class. See Dark mode.

Resolved values

tokens.resolved.json holds every token whose type is a number (dimension, number, fontWeight, duration) resolved to a plain number in each of the four contexts (Component tokens). An app that can't evaluate CSS reads it instead of tokens.json, whose derived sizes are CSS expressions such as calc(var(--control-height-small) + 2 * var(--list-toolbar-air) + 1px).

  • It keeps the groups of tokens.json. A token is an object with its $type and a $value holding one number per context: touch (the token's own value), fine (fine, else the token's own value), desktop (desktop, else fine, else the token's own value) and wideTouch (wideTouch, else the token's own value).
  • A dimension is in px (1rem is 16px), a duration in ms; a number and a fontWeight have no unit.
  • The generator evaluates every reference, var() and calc() in the context it resolves, as the browser does under the same media query: on a desktop, list-toolbar-height is the desktop header height, 44. A value it can't evaluate (a function other than var() and calc(), a unit other than px, rem, ms and s, a missing or circular reference) fails the build with the token and the context in the message.
  • Colors, shadows and easing curves aren't in it; read them from tokens.json or foundation.css.
json
{
  "list-toolbar": {
    "height": {
      "$type": "dimension",
      "$value": { "touch": 49, "fine": 49, "desktop": 44, "wideTouch": 49 }
    }
  },
  "list-row": {
    "min-height": {
      "$type": "dimension",
      "$value": { "touch": 56, "fine": 0, "desktop": 0, "wideTouch": 56 }
    }
  },
  "header": {
    "height": {
      "$type": "dimension",
      "$value": { "touch": 56, "fine": 56, "desktop": 44, "wideTouch": 48 }
    }
  }
}

The file itself writes every object on its own lines.

Token grammar

Names are built from a few parts, so a name you haven't seen tells you what it is for.

KindPatternExamples
Neutral roles{role}(-{purpose})(-{intensity})layer-canvas, foreground-hint, line-seam, fill-medium, foreground-on-hud
Color roles{family}(-{slot})brand, brand-soft, danger-strong, info-muted
Signalsyou, selectedyou, selected
Ink stepsink-{alpha}ink-8, ink-40
Palettepalette-{color}-{step}palette-yellow-400, palette-lavender-800
Statusestask-status-{status}(-soft|-strong), presence-{state}(-soft)task-status-in-review-soft, presence-busy, presence-busy-soft
Stickerssticker-{part}sticker-ink, sticker-edge, sticker-medium
Shadowselevation-{level}, focus-ringelevation-float, elevation-sticker
Metrics{part}-{property}field-font-size, card-title-line-height, list-row-min-height (Component tokens)

Neutral roles. The role is one of four:

  • foreground-*: text and icons;
  • layer-*: a surface, in the order things stack (frame, sidebar, canvas, card, popover);
  • line-*: a line;
  • fill-*: a fill laid into or over a surface.

The purpose says where the token is used: frame, sidebar, canvas, card, popover, code, hud, on-frame, on-hud, link, field. Intensity runs from the bare name down to -muted, then -hint for text, and from -hairline through -seam to -strong for lines.

Color roles. The family is one of brand, attention, info, success, warning, danger or inactive. The slot says which shade:

SlotIs
bare (info)The solid color: a sticker's fill
-strongA deep shade, readable as text
-mutedA strong tint
-softA pale tint, without a border; see Soft tints
-graphicA chart mark's fill or stroke, 3:1 against the surfaces. Only warning has one; see Warnings in charts
-foregroundText on the solid color, where a family has its own
-hover, -activeThe pair a solid fill takes on hover and press. A family has both or neither
-50 to -950The numbered ramp. Only brand and attention have one

Signals. you and selected are the yellow of what is addressed to you and of the selected sticker. They hold their own value instead of pointing at brand, so no theme grays them (Themes).

Opacity. Every layer token is opaque except the two scrims, layer-backdrop and layer-backdrop-nested, and the cover over something busy, layer-veil (Surfaces). fill-muted and fill-strong are opaque. fill-subtle, fill-medium, fill-frame-medium and sticker-medium are translucent: they are the hover tiers, laid on top of a control or a row, and fill-medium is also the track of a meter or progress bar (Hover overlays).

Utilities. A Tailwind utility is the property's prefix and the token name: bg-layer-card, text-foreground-muted, border-line-strong. Shadows are named apart: shadow-float for elevation-float, shadow-sticker for elevation-sticker, shadow-focus for focus-ring. The numbered palette steps are only custom properties, not utilities; the bare bg-palette-yellow and its siblings are the exception.

Component tokens

A component token is a size that the web and the iOS and Android apps both draw: a row's height, a control's or a toolbar's height, a step of spacing between parts. It lives in tokens.json so that both read one value, and a change reaches every platform at once.

What goes in. Only a decision both the web and the apps must follow: something a person comparing a phone web page with the app's page would see as a difference. A list row's least height, the toolbar over a list, the avatar column of a message and its gap to the text.

What stays out. A pixel the web needs for its own drawing stays in the component's recipe: an optical offset, a hit area the app gets from its platform, a radius that follows a height, a size only a mouse ever sees, and anything an app draws natively, such as the iOS tab bar (Navigation). A value that exists already isn't registered twice: a size equal to another token is written as that token (var(--header-height)), so they move together, and a size that follows from other tokens is derived where it is used, as the timeline's row step is twice timeline-row-inset.

Four contexts. A token's own value ($value) is what a phone shows, and a touch screen at any width unless the token has wideTouch; it is the value an app reads. desktop is the value from 768px with a mouse or a trackpad. fine is the value with a mouse or a trackpad at any width, for a size that follows the input rather than the width: a narrow window with a mouse takes it, and a desktop takes it unless the token has desktop too. wideTouch is the value from 768px by touch (the apps' wide touch layout, from 744pt), for the few sizes a wide touch screen draws differently from a phone: a head and its bar buttons (artin, #wg-mobile-sync:#265, Raft 1.29). Never write a phone's value as an extension: it is the token's own, so an app never has to read one.

ContextGetsIn tokens.resolved.json
A phone, a touch screen under 768px (the apps under 744pt)The token's own valuetouch
A touch screen from 768px (the apps from 744pt)wideTouch, else the token's own valuewideTouch
A window under 768px with a mouse or a trackpadfine, else the token's own valuefine
A desktop: from 768px with a mouse or a trackpaddesktop, else fine, else the token's own valuedesktop

A device with no pointer at all takes the token's own value.

Names. A component token is {component}-{property}: the group is the kind of thing it sizes, in the words the docs use (list-row, list-toolbar, avatar-column, mobile-nav), and the property is one of height, min-height, size, width, inset (above and below the content; inset-bottom below it), gap (between two parts) or air (around a control in a bar). A suffix says what kind of bound it is: -min for a least value (mobile-nav-inset-bottom-min). A size of the same kind as a group that exists joins it (control-height-small) instead of starting a group, and one size two components share is one group they both read (avatar-column, for a message row and a list row), never a copy in each.

Descriptions. Every component token's $description says what it sizes, its value on a phone and on a desktop in words, why it is that size, and why it is shared: which screens on the web and in the apps draw it. It names the decision (who, when, where) when there was one. A description that can't say why the apps need the value is a sign the value belongs in a recipe.

Using them. A recipe reads a component token through its utility (h-control-small, min-h-list-row, py-list-row-inset, w-avatar-column, size-avatar-column, gap-avatar-column-gap, min-h-list-toolbar, py-list-toolbar-air, in styles.css) or, where there is none, its custom property (min-h-[calc(var(--mobile-nav-height)+…)]), and adds no breakpoint and no pointer query of its own for that property: the token switches once, in the token layer. Where the web needs a different value on top, such as a mouse's 64px floor on ListRow, the line that adds the breakpoint sits right under a comment saying so, // web-only: <reason>, the one comment a recipe's class list takes, so a check can tell a deliberate refinement from a breakpoint left over from before the token.

ts
const listRow = tv({
  base: [
    "min-h-list-row py-list-row-inset",
    // web-only: with a mouse ListRow keeps its 64px floor and 12px inset, its current values until someone rules on them
    "pointer-fine:min-h-16 pointer-fine:py-3",
  ],
});

packages/ui/src/size-tokens.test.ts checks three things: a token's value written by hand (h-8 md:pointer-fine:h-control where h-control-small is meant, also inside a calc()); a breakpoint on a property a token sets in the same class list, unless it is under a web-only comment; and a size that switches with the pointer (py-3 pointer-fine:py-2) where no token is read, unless it is under a web-only comment. The pointer switches written before the third check are listed in the test as sizes still to lift into tokens. The list only shrinks: a new switch fails, and so does an entry that is no longer in the code.

Token groups

Each block below is generated from tokens.json and shows the light and dark values.

Palette

The raw colors the roles point at. The rules for using them directly are in Color.

TokenLightDark
palette-yellow-50
#fff9ed
#fff9ed
palette-yellow-100
#fff6e3
#fff6e3
palette-yellow-200
#ffe9b9
#ffe9b9
palette-yellow-300
#ffdf91
#ffdf91
palette-yellow-400
#ffd441
#ffd441
palette-yellow-500
#d3ad03
#d3ad03
palette-yellow-600
#a78802
#a78802
palette-yellow-700
#7a6300
#7a6300
palette-yellow-800
#534300
#534300
palette-yellow-900
#2d2300
#2d2300
palette-yellow-950
#1c1500
#1c1500
palette-lavender-50
#f7f6fc
#f7f6fc
palette-lavender-100
#efecf9
#efecf9
palette-lavender-200
#dcd7f2
#dcd7f2
palette-lavender-300
#ccc4ec
#ccc4ec
palette-lavender-400
#bbafe6
#bbafe6
palette-lavender-500
#9d8ada
#9d8ada
palette-lavender-600
#7f62cb
#7f62cb
palette-lavender-700
#6341b0
#6341b0
palette-lavender-800
#442b7c
#442b7c
palette-lavender-900
#251548
#251548
palette-lavender-950
#170c31
#170c31
palette-pink-50
#fff0f4
#fff0f4
palette-pink-100
#ffe1e8
#ffe1e8
palette-pink-200
#fec1d2
#fec1d2
palette-pink-300
#fea0bc
#fea0bc
palette-pink-400
#fe7da8
#fe7da8
palette-pink-500
#fe2f8b
#fe2f8b
palette-pink-600
#d4086f
#d4086f
palette-pink-700
#9f0551
#9f0551
palette-pink-800
#700238
#700238
palette-pink-900
#42011e
#42011e
palette-pink-950
#2f0014
#2f0014
palette-cyan-50
#ecf9ff
#ecf9ff
palette-cyan-100
#d7f2fe
#d7f2fe
palette-cyan-200
#a9e6fe
#a9e6fe
palette-cyan-300
#68dafd
#68dafd
palette-cyan-400
#28ccf3
#28ccf3
palette-cyan-500
#1ea6c6
#1ea6c6
palette-cyan-600
#15849f
#15849f
palette-cyan-700
#0e6276
#0e6276
palette-cyan-800
#06414f
#06414f
palette-cyan-900
#02252f
#02252f
palette-cyan-950
#01161c
#01161c
palette-orange-50
#fef5f1
#fef5f1
palette-orange-100
#fde6de
#fde6de
palette-orange-200
#fbd1c0
#fbd1c0
palette-orange-300
#f9b899
#f9b899
palette-orange-400
#f8a16f
#f8a16f
palette-orange-500
#dd7e34
#dd7e34
palette-orange-600
#ad6127
#ad6127
palette-orange-700
#83481a
#83481a
palette-orange-800
#5b310f
#5b310f
palette-orange-900
#331905
#331905
palette-orange-950
#220e02
#220e02
palette-lime-50
#f1fde9
#f1fde9
palette-lime-100
#dcfac1
#dcfac1
palette-lime-200
#c0f588
#c0f588
palette-lime-300
#b4e67f
#b4e67f
palette-lime-400
#a9d877
#a9d877
palette-lime-500
#8ab261
#8ab261
palette-lime-600
#6b8b4a
#6b8b4a
palette-lime-700
#506836
#506836
palette-lime-800
#344522
#344522
palette-lime-900
#1c2711
#1c2711
palette-lime-950
#101808
#101808
palette-red-50
#fef1f0
#fef1f0
palette-red-100
#fddedd
#fddedd
palette-red-200
#fbbdb9
#fbbdb9
palette-red-300
#fa9991
#fa9991
palette-red-400
#f97264
#f97264
palette-red-500
#eb4423
#eb4423
palette-red-600
#bb3419
#bb3419
palette-red-700
#8e2510
#8e2510
palette-red-800
#621708
#621708
palette-red-900
#3e0b03
#3e0b03
palette-red-950
#280501
#280501
palette-stone-50
#f7f6f5
#f7f6f5
palette-stone-100
#efedeb
#efedeb
palette-stone-200
#e0dcd7
#e0dcd7
palette-stone-300
#d2cbc2
#d2cbc2
palette-stone-400
#c0b9b1
#c0b9b1
palette-stone-500
#9d9891
#9d9891
palette-stone-600
#7b7671
#7b7671
palette-stone-700
#5d5955
#5d5955
palette-stone-800
#3e3b38
#3e3b38
palette-stone-900
#23211f
#23211f
palette-stone-950
#141312
#141312
palette-cream-50
#fffdf9
#fffdf9
palette-cream-100
#fffcf5
#fffcf5
palette-cream-200
#fffaef
#fffaef
palette-cream-300
#f9eccf
#f9eccf
palette-cream-400
#ebd38f
#ebd38f
palette-cream-500
#d2b100
#d2b100
palette-cream-600
#a78c00
#a78c00
palette-cream-700
#7c6800
#7c6800
palette-cream-800
#554500
#554500
palette-cream-900
#312700
#312700
palette-cream-950
#191300
#191300

Text and icons

foreground and its tiers, and the text colors for the frame and the HUD. Usage and contrast: Color, Typography.

TokenLightDark
foreground
#141111
#e5e5e2
foreground-muted
#141111 / 68%
#c4c4c1
foreground-hint
#141111 / 62%
#9e9e9b
foreground-disabled
#141111 / 30%
#636360
foreground-inverse
#ffffff
#1b1b19
foreground-on-hud
#f3f3f5
#e5e5e2
foreground-on-hud-mutedSecondary text on the HUD: the shortcut in a tooltip, the detail line of a toast.
#f3f3f5 / 70%
#c4c4c1foreground-muted
foreground-on-frame
#141111sticker-ink
#e5e5e2
foreground-on-frame-muted
#564919
#9e9e9b
foreground-on-frame-active
#141111sticker-ink
#141111sticker-ink
foreground-link
#184f95
#6da7ec
foreground-active
#141111foreground
#e5e5e2foreground
foreground-hover
#141111foreground
#e5e5e2foreground

Surfaces

Usage: Color.

TokenLightDark
layer-canvas
#ffffff
#1b1b19
layer-sidebar
#fffaef
#0d0d0b
layer-popover
#ffffff
#292927
layer-backdrop
#000000 / 65%
#000000 / 60%
layer-backdrop-nested
#000000 / 40%
#000000 / 40%
layer-veilThe cover over something busy or loading in place: an image uploading or that failed, a preview being prepared. The page at 80%, so what is under it shows through, dimmed, and a default-colour Spinner on it reads in both modes. Translucent by contract, like the two backdrops.
#ffffff / 80%
#1b1b19 / 80%
layer-card
#ffffff
#242422
layer-hud
#252429
#292927
layer-frame
#ffd440
#0d0d0b
layer-frame-active
#ffffff
#ffd440
layer-code
#ffffff
#0a0c10

Fills

Usage: Color and Hover overlays.

TokenLightDark
fill-muted
#f3f3f3
#32322f
fill-strong
#eaeaea
#3a3a37
fill-subtleHover tier subtle (light): hover on large things people read, a row, a message, a readable card, and a row whose menu is open. About 2.5 to 3 OKLab dE in both modes, on paper, the sidebar and cards alike, under every selection tint, so text keeps its contrast.
#141111 / 4%
#fafaf7 / 3%
fill-mediumHover tier medium: hover on small controls (buttons, icon buttons, chips, tabs, segment items) and press on everything, on paper-coloured surfaces. About 5.5 to 6.5 OKLab dE; dark is lighter than light because the same ink alpha shows more on a dark surface.
#141111 / 8%
#fafaf7 / 7%
fill-frame-mediumHover tier medium on the frame (rail items, on-frame buttons, the workspace button): hover and press. Its own alphas because ink shows differently on the yellow and on the near-black frame: 10% on the yellow and 6% on the dark frame land on the medium step, about 6 OKLab dE.
#141111 / 10%
#fafaf7 / 6%
fill-cell-hoverA list cell's hover and its menu-open fill (lib/list-cell.ts), drawn on the cell's inset shape. fill-subtle in light. In dark it steps up to 7.5% ink, so the rounded shape reads on a dark surface, where fill-subtle's 3% barely shows. Rows only: the global tiers don't change.
#141111 / 4%fill-subtle
#fafaf7 / 8%
fill-cell-pressA list cell's press fill, the same with a mouse and on a touch screen. fill-medium in light. In dark 12% ink, a clear step over the cell's dark hover.
#141111 / 8%fill-medium
#fafaf7 / 12%
fill-cell-selectedA list cell that is selected or open beside its list (an active InboxItem, a selected ListRow), and the located highlight on a cell. info-soft in light. In dark the cyan at 38% instead of 18%, so a selected cell stands out from a hovered one.
#d7f2feinfo-soft
#005f7a / 38%

Lines

Usage and widths: Color, Shape.

TokenLightDark
line-strong
#141111
#e5e5e2
line-seam
#141111 / 45%
#fafaf7 / 26%
line-hairline
#141111 / 15%
#fafaf7 / 10%
line-frame-active
#141111sticker-ink
#141111sticker-ink
line-fieldThe frame of a field and the composer: the ink and width of line-strong, drawn 1.5px.
#141111line-strong
#e5e5e2line-strong
line-field-hover
#141111line-strong
#e5e5e2line-strong

Ink steps

Translucent steps of ink that lines, secondary text and overlays are made from. Use the role tokens; reach for an ink step only for a one-off wash.

TokenLightDark
ink-2
#141111 / 2%
#fafaf7 / 2%
ink-4
#141111 / 4%
#fafaf7 / 4%
ink-6
#141111 / 6%
#fafaf7 / 6%
ink-8
#141111 / 8%
#fafaf7 / 8%
ink-10
#141111 / 10%
#fafaf7 / 10%
ink-16
#141111 / 16%
#fafaf7 / 16%
ink-20
#141111 / 20%
#fafaf7 / 20%
ink-30
#141111 / 30%
#fafaf7 / 30%
ink-40
#141111 / 40%
#fafaf7 / 40%
ink
#141111
#fafaf7

Color roles

What each color means: Meanings of color.

TokenLightDark
brand-50
#fff9edpalette-yellow-50
#fff9edpalette-yellow-50
brand-100
#fff6e3palette-yellow-100
#fff6e3palette-yellow-100
brand-200
#ffe9b9palette-yellow-200
#ffe9b9palette-yellow-200
brand-300
#ffdf91palette-yellow-300
#ffdf91palette-yellow-300
brand-400
#ffd440
#ffd440
brand-500
#d3ad03palette-yellow-500
#d3ad03palette-yellow-500
brand-600
#a78802palette-yellow-600
#a78802palette-yellow-600
brand-700
#7a6300palette-yellow-700
#7a6300palette-yellow-700
brand-800
#534300palette-yellow-800
#534300palette-yellow-800
brand-900
#2d2300palette-yellow-900
#2d2300palette-yellow-900
brand-950
#1c1500palette-yellow-950
#1c1500palette-yellow-950
brand-strong
#564919
#ffd440
brand-soft
#fff0bd
#876f1f / 20%
brand-edge
#141111sticker-ink
#141111sticker-ink
brand-glow
#ffd440
#ffd440
brand-hoverHovering or pressing a sticker lays sticker-medium (10% ink) over its colour.
color-mix(in srgb, var(--brand-400) 90%, var(--sticker-ink))
color-mix(in srgb, var(--brand-400) 90%, var(--sticker-ink))
brand-active
color-mix(in srgb, var(--brand-400) 90%, var(--sticker-ink))brand-hover
color-mix(in srgb, var(--brand-400) 90%, var(--sticker-ink))brand-hover
TokenLightDark
attention-50
#fff0f4palette-pink-50
#fff0f4palette-pink-50
attention-100
#ffe1e8palette-pink-100
#ffe1e8palette-pink-100
attention-200
#fec1d2palette-pink-200
#fec1d2palette-pink-200
attention-300
#fea0bcpalette-pink-300
#fea0bcpalette-pink-300
attention-400
#ff99c3
#ff99c3
attention-500
#fe7da8palette-pink-400
#fe7da8palette-pink-400
attention-600
#d4086fpalette-pink-600
#d4086fpalette-pink-600
attention-700
#9f0551palette-pink-700
#9f0551palette-pink-700
attention-800
#700238palette-pink-800
#700238palette-pink-800
attention-900
#42011epalette-pink-900
#42011epalette-pink-900
attention-950
#2f0014palette-pink-950
#2f0014palette-pink-950
attention-strong
#c00064
#ffacc7
attention-soft
#ffd6e2
#d0457c / 16%
attention-hover
color-mix(in srgb, var(--attention-400) 90%, var(--sticker-ink))
color-mix(in srgb, var(--attention-400) 90%, var(--sticker-ink))
attention-active
color-mix(in srgb, var(--attention-400) 90%, var(--sticker-ink))attention-hover
color-mix(in srgb, var(--attention-400) 90%, var(--sticker-ink))attention-hover
TokenLightDark
infoEvery solid is a sticker: ink type on the colour in both modes.
#27ccf3
#27ccf3
info-strong
#06414fpalette-cyan-800
#6ccdea
info-muted
#a9e6fepalette-cyan-200
#007592 / 28%
info-soft
#d7f2fe
#005f7a / 18%
info-hover
color-mix(in srgb, var(--info) 90%, var(--sticker-ink))
color-mix(in srgb, var(--info) 90%, var(--sticker-ink))
info-active
color-mix(in srgb, var(--info) 90%, var(--sticker-ink))info-hover
color-mix(in srgb, var(--info) 90%, var(--sticker-ink))info-hover
TokenLightDark
success
#a9d877
#a9d877
success-foreground
#141111sticker-ink
#141111sticker-ink
success-strong
#344522palette-lime-800
#b7e18c
success-muted
#c0f588palette-lime-200
#0c7d43 / 28%
success-soft
#dcfac1
#167641 / 18%
TokenLightDark
warning
#f8a16f
#f8a16f
warning-foreground
#141111sticker-ink
#141111sticker-ink
warning-strong
#5b310fpalette-orange-800
#ffaf76
warning-mutedThe warning's strong wash. Amber in light mode (hue 72), not the orange of the solid: a light orange wash at this lightness reads pink and was hard to tell from danger-muted (hue 23) side by side; 49 degrees apart it isn't.
#ffd39d
#ac571d / 28%
warning-softThe warning's soft wash, under warning banners and notices. Amber in light mode (hue 72), 52 degrees from danger-soft (hue 20), so a warning and a danger surface side by side differ in hue and not only in icon; dark mode keeps the orange at 18%, which already reads amber on the dark canvas.
#ffe7cb
#9e511e / 18%
warning-graphicA failure or warning drawn as a graphic in data visualisation: the fill or stroke of a chart mark, such as a failed route in a migration chart. The warning orange, deep enough in light mode and bright in dark mode to stand at least 3:1 against the canvas, sidebar, card and popover (WCAG 1.4.11). Never text: warning text takes warning-strong.
#d66919
#f89961
warning-hover
color-mix(in srgb, var(--warning) 90%, var(--sticker-ink))
color-mix(in srgb, var(--warning) 90%, var(--sticker-ink))
warning-active
color-mix(in srgb, var(--warning) 90%, var(--sticker-ink))warning-hover
color-mix(in srgb, var(--warning) 90%, var(--sticker-ink))warning-hover
TokenLightDark
dangerdanger = the destructive sticker (red fill, ink type); danger-strong is the error ink for invalid fields and destructive menu items.
#f97264
#f97264
danger-foreground
#141111sticker-ink
#141111sticker-ink
danger-strong
#b5321a
#f8a49d
danger-muted
#fbbdb9palette-red-200
#d33c30 / 30%
danger-soft
#fddedd
#c93126 / 18%
danger-hover
color-mix(in srgb, var(--danger) 90%, var(--sticker-ink))
color-mix(in srgb, var(--danger) 90%, var(--sticker-ink))
danger-active
color-mix(in srgb, var(--danger) 90%, var(--sticker-ink))danger-hover
color-mix(in srgb, var(--danger) 90%, var(--sticker-ink))danger-hover
TokenLightDark
inactive
#c0b9b1
#c0b9b1
inactive-foreground
#141111sticker-ink
#141111sticker-ink
inactive-soft
#e0dcd7
#32322f

Statuses

Task statuses and presence lights: Statuses.

TokenLightDark
task-status-todo
#f8a16f
#ff6900
task-status-todo-soft
#fde6de
#9e511e / 18%
task-status-todo-strong
#5b310fpalette-orange-800
#ffaf76
task-status-in-progress
#27ccf3
#27ccf3
task-status-in-progress-soft
#d7f2fe
#005f7a / 18%
task-status-in-progress-strong
#06414fpalette-cyan-800
#6ccdea
task-status-in-review
#bbafe6
#9d8ada
task-status-in-review-soft
#efecf9
#6853a0 / 24%
task-status-in-review-strong
#442b7cpalette-lavender-800
#ccc4ecpalette-lavender-300
task-status-done
#a9d877
#20c16b
task-status-done-soft
#dcfac1
#167641 / 18%
task-status-done-strong
#344522palette-lime-800
#6ed892
task-status-closed
#c0b9b1
#8f8f8d
task-status-closed-soft
#e0dcd7
#32322f
task-status-closed-strong
#3e3b38palette-stone-800
#9e9e9b
TokenLightDark
presence-online
#a9d877
#a9d877
presence-busyYellow for an agent at work, and for Status variant="primary". The value of brand in Raft Yellow, but its own, so a theme that grays the brand (Boring Gray) keeps a working agent yellow.
#ffd440
#ffd440
presence-busy-softThe tint of the Working chip (Badge variant="busy"). The value of brand-soft in Raft Yellow, but its own, so Boring Gray keeps it yellow.
#fff0bd
#876f1f / 20%
presence-error
#f8a16f
#f8a16f
presence-offline
#c0b9b1
#c0b9b1
presence-external
#27ccf3
#27ccf3

Stickers

Usage: Stickers.

TokenLightDark
sticker-ink
#141111
#141111
sticker-paper
#ffffff
#ffffff
sticker-edge
#141111 / 0%
#fafaf7 / 35%
sticker-mediumHover tier medium on a colour sticker (primary, warning and danger buttons, colour badges, the selected segment on press): hover and press, 10% ink in both modes.
#141111 / 10%
#141111 / 10%
sticker-ink-mediumHover tier medium on an ink sticker (the server tile in the rail or the sidebar header): hover, press and open, 6% paper in both modes, since ink laid over ink doesn't show.
#ffffff / 6%
#ffffff / 6%

Shadows and the focus ring

Usage: Elevation, Accessibility.

TokenLightDark
elevation-floatControls never cast a shadow; only overlays float.
0 1px 0 oklch(0.1813 0.005 17.62 / 0.039), 0 12px 32px -12px oklch(0.1813 0.005 17.62 / 0.322)
0 0 0 1px oklch(0.9843 0.004 106.47 / 0.078), 0 16px 40px -12px oklch(0 0 0 / 0.8)
elevation-sticker
4px 4px 0 oklch(0.1813 0.005 17.62)
4px 4px 0 oklch(0 0 0)
TokenLightDark
focus-ringThe focus indicator. It shows only after keyboard navigation: styles.css empties it while the root carries data-input-modality="pointer", which installInputModality sets after a click or a tap.
0 0 0 2px oklch(1 0 0), 0 0 0 4px oklch(0.1813 0.005 17.62)
0 0 0 2px oklch(0.2213 0.0038 106.71), 0 0 0 4px oklch(0.9211 0.004 106.48)

Metrics

The type metrics a field and a card title share with the parts laid out beside them. Usage: Typography.

TokenLightDarkDesktop
field-font-size16px16px14px
field-font-weight400400
field-line-height24px24px22px
field-gapBetween two fields of a form, and between the parts of a form section: two airs.calc(2 * var(--control-air))calc(2 * var(--control-air))
TokenLightDarkDesktop
card-title-font-size16px16px14px
card-title-font-weight600600
card-title-line-height24px24px22px

The control metrics: a default control's height, the small control's (control-height-small), its icon and hit area, and what a control embedded in a frame keeps: control-embedded-inset, its distance from the frame's outer edge and from its sibling, and control-embedded-size, a chip's or a button's height in a field (Spacing, Shape).

TokenLightDarkDesktop
control-heightA default control: a field, a select, a Button, a tab, a selected segment, a menu option, a sidebar row. A finger's 44px on a phone; 34px on a desktop, the one desktop size for all of them (stdrc, 2026-11-04; Feishu's 32px before).44px44px34px
control-height-smallA small control: Button md and icon-md, a filter trigger, a filter chip, a tab, a segment, a field in a toolbar (InputGroup md). 32px on a phone and a touch screen, its hit area still reaching 44px; the control height (34px) on a desktop. Shared with the apps: the controls in the toolbar over a list are this size, and the toolbar's height is built on it.32px32pxvar(--control-height)
control-height-ctaThe full-width call to action across a sign-in, sign-up or setup form (Button xl).52px52px40px
control-icon-sizeThe icon in a control-height icon button.22px22px18px
control-hit-insetHow far a control-height button's hit area reaches past its top and bottom, to keep 44px.0px0px5px
control-embedded-insetHow far a chip or a button embedded in a field, the composer or a corner sits inside its frame's outer edge, and from its sibling.6px6px
control-embedded-sizeA chip or a button embedded in a field: the control height less the embedded inset above and below, so the field keeps its height.32px32px22px
control-airThe air of the size chain: between a label, its control and its help, around a control in a bar, and half of the gap between two fields. Every step below is the control height plus or minus a number of airs.6px6px
control-radiusThe corner of a control at the control height (a field, a Select, a Button at lg and icon-lg), about a quarter of its height: 10px at 44 on a phone and a touch screen, 8px at 34 on a desktop.10px10px8px

The bars and the items in them: a header's height and air, a bar button and its icon (bar-icon-size), a row's icon-only action (row-action-size, Button icon-sm), an item on the frame, the rail, and the switch's track (Spacing, Responsive layout).

TokenLightDarkDesktop
header-heightEvery header: a panel, a sidebar or a thread head, a dialog's bar, a drawer's head, a rail head. The control height with the header air above and below, so the seams of a screen line up: 56 on a phone (44 + 12), 44 on a desktop (34 + 10). By touch from 768px (a tablet, an unfolded foldable, a phone held sideways that wide) the bar button with the header air above and below, 48 (36 + 12): a wide touch screen has room for more of the content, not for taller heads (artin, #wg-mobile-sync:#265, mobile #5576; the apps from 744pt, Raft 1.29).calc(var(--control-height) + 2 * var(--header-air))calc(var(--control-height) + 2 * var(--header-air))
header-airThe air above and below the control in a header: one control air on a phone and a touch screen (44 + 12 = 56); 5px on a desktop, so a 34px control and its head make 44 (34 + 10).var(--control-air)var(--control-air)5px
header-height-shortEvery header in a window shorter than 600px. On a desktop, a bar button with one air above and below (28 + 12 = 40).48px48pxcalc(var(--bar-button-size) + 2 * var(--control-air))
TokenLightDarkDesktop
bar-button-sizeAn icon button in a bar: a head's actions and its x, and the composer's icons with a mouse (by touch they are the 32px icon-md). The control height on a phone; 28px on a desktop, the size of the header's icon tile, so a head's tile and buttons share one size and one centre line. By touch from 768px the frame item's 36px, so a head's buttons sit in the 48px head with the header air above and below, as the top bar's items do, not as a 44px button with 2px (Raft 1.29, mobile #5583). Its hit area still reaches 44px.var(--control-height)var(--control-height)28px
bar-button-radiusThe corner of a bar button, about a quarter of its height: 10px at 44 on a phone and at 36 by touch from 768px, 6px at the 28px bar button with a mouse on a desktop.10px10px6px
TokenLightDark
bar-icon-sizeThe icon in a bar button: a head's actions and its x, a selection toolbar's buttons. The control's icon size (22px on a phone, 18px on a desktop); by touch from 768px 20px in the 36px bar button, as the apps draw it (Raft 1.29, MobileShortHead).var(--control-icon-size)var(--control-icon-size)
TokenLightDarkDesktop
row-action-sizeAn icon-only action on a line of a row or a card (Button icon-sm): a comment header's More, a list row's trailing action. 28px on a phone and a touch screen, where its hit area still reaches 44px, so a line of text keeps its height; the bar button's size (28px) on a desktop, so a row's action and a head's are one size with a mouse. Shared with the apps: a comment's or a row's action is drawn at this size on every platform.28px28pxvar(--bar-button-size)
TokenLightDarkDesktop
frame-item-heightAn item on the frame: the top bar's and the title bar's buttons, the workspace button and the search box. 36px on a phone and a touch screen; the control height on a desktop, so the top bar is a header (34 + 2 x 5 = 44 with a mouse).36px36pxvar(--control-height)
TokenLightDarkDesktop
rail-widthThe rail, its 1px seam included: 57px on a touch screen, 49px on a desktop (48 + 1, the short window's rail). Its own size, not the header's.57px57pxvar(--rail-width-short)
rail-itemA rail item: 40px on a touch screen, 36px on a desktop.40px40pxvar(--rail-item-short)
rail-width-shortThe rail in a window shorter than 600px, its 1px seam included; with a mouse the rail is always this width (48 + 1).49px49px
rail-item-shortA rail item in a window shorter than 600px; with a mouse rail items are always this size.36px36px
TokenLightDarkDesktop
switch-widthThe switch's track: 50 x 30 on a phone and a touch screen, macOS's regular 38 x 22 on a desktop. Its knob is the track height less 8px (a 1.5px border and 2.5px of padding each side, so the 1px of track between the knob's ring and the border stays) and travels the width less the height.50px50px38px
switch-heightThe switch's track height.30px30px22px

The rows: a sidebar row, an option of a popup list, and the inset of a settings row (Spacing).

TokenLightDarkDesktop
row-heightA sidebar row from 768px, 2px apart; its highlight fills the row. On a desktop the control height (34px): one size for a sidebar item, a menu option, a compact list row, a field, a select, a Button, a tab and a selected segment (stdrc, 2026-11-04). A phone list of places keeps 44px.38px38pxvar(--control-height)
TokenLightDarkDesktop
option-heightAn option of a popup list or a menu item with one line: 36px on a phone and a touch screen, the row height (34px, the control height) on a desktop.2.25rem2.25remvar(--row-height)
TokenLightDark
settings-row-insetAbove and below the tallest part of a settings row (ListRow plain): two airs.calc(2 * var(--control-air))calc(2 * var(--control-air))

The page: the gap between two sections of a form, and a page's top and inset (Page structure, Desktop density).

TokenLightDarkDesktop
section-gapBetween two sections of a form (FormSection), half above and half below the hairline between them: 32px on a phone and a touch screen, two field gaps (24px) on a desktop.32px32pxcalc(2 * var(--field-gap))
TokenLightDarkDesktop
page-topFrom a head's seam to the first thing of the content under it: the page inset on a phone and a touch screen; 12px on a desktop, so the content sits close under its compact head (stdrc, 2026-11-05).var(--page-inset)var(--page-inset)12px
page-insetThe inset of a column's content, a settings page, a drawer's body and a dialog's form: 16px on a phone and a touch screen; 16px with a mouse on a desktop too (20 before 2026-11-05), where the column margin, the list cells' content and the heads follow it, one edge.16px16px16px

The component tokens shared with the apps (Component tokens): a row with an avatar and a preview (list-row), the toolbar over a list (list-toolbar), the avatar column a message row and a list row start with (avatar-column), and the phone tab bar the Android app draws itself (mobile-nav).

TokenLightDarkMouse
list-row-min-heightThe least height of a row with an avatar and a preview: a conversation, a person, an agent, an Activity or Inbox item, a search result (ListRow default, InboxItem, SearchEntity). 56px on a touch screen at any width: the whole row is the target, so it needs no air past 44px, and one more conversation fits on a phone screen. No floor with a mouse or a trackpad: the row is its content and its inset. Shared with the apps, whose lists of conversations and people are the same rows.56px56px0px
list-row-insetAbove and below the content of a row with an avatar and a preview: 8px at every width and with every pointer, so a two-line Activity item is 60px with a mouse (stdrc, 2026-11-04). The 12px a narrow window with a mouse had was a breakpoint's accident, not a decision (Kirby, 2026-11-23, #proj-raft-ui:#293). Shared with the apps: with the least height it sets how many rows of conversations a screen shows.8px8px
TokenLightDarkDesktop
list-toolbar-airIn the toolbar over a list: above and below its small controls on a phone and a touch screen, and between its two lines. Shared with the apps: it sets the toolbar's height on a phone.8px8px
list-toolbar-heightOne line of the toolbar over a list, its seam included: 49px on a phone and a touch screen (8 + 32 + 8 + 1), a row of controls and not a header, as Material's chip rows are 48dp; the header height (44px) on a desktop. A second line adds the air and a small control: 89px and 86px (Jasper, 2026-11-10, #proj-raft-ui:f9756e85). Shared with the apps: every page of a list has the same toolbar.calc(var(--control-height-small) + 2 * var(--list-toolbar-air) + 1px)calc(var(--control-height-small) + 2 * var(--list-toolbar-air) + 1px)var(--header-height)
TokenLightDark
avatar-column-sizeThe leading avatar column of a message row and of a list row with an avatar and a preview: the avatar (Avatar md), and the column a message's continuation rows keep under it. 35px at every width, so every message's text and every row's title start on one line. One group for both, so a timeline and a list beside it never drift apart. Shared with the apps, whose timelines and lists are drawn from it.35px35px
avatar-column-gapFrom the avatar column to the text beside it, in a message row and in a list row with an avatar. Shared with the apps: with the column's size it sets where a message's and a row's text start.12px12px
TokenLightDark
mobile-nav-heightThe phone tab bar (MobileNav) above its bottom inset, its 1px top seam included: 52px (1 + 10 + a 22px icon + 7 + a 12px label line). Shared with the Android app, which draws its own bottom bar with this height; the iOS app draws the system tab bar instead.52px52px
mobile-nav-inset-bottom-minThe least space under the tab bar's content: 8px on a screen without a bottom safe area; a larger safe area replaces it (on the web up to 34px). Shared with the Android app, which pads its own bottom bar the same way.8px8px

The timeline rhythm: the message step and the section step between the lines of a conversation, and the row inset each row keeps around its text (Spacing).

TokenLightDark
timeline-gap-messageThe message step of a timeline: from the last line of one turn to the first line of the next (a sender line, an event line). Every row keeps the row inset above and below its text; the first row of a turn adds the rest above it.16px16px
timeline-gap-sectionThe section step of a timeline, one step wider than the message step: either side of a date line, from the top of the list to the first line, and from the last line to the composer, so a boundary reads as one and the last message never sits on the composer.24px24px
timeline-row-insetHow far a timeline row's hover and selected highlight reaches above and below its text. Two rows of one turn sit two insets apart.4px4px

The fade lengths: fade-content where content is cut across its height, fade-edge at the sides of a strip that scrolls (Edges fade). And the dimmed opacity, for something present but not active (Dimmed).

TokenLightDark
fade-edgeThe fade at the edge of a strip that scrolls sideways (mask-fade-x): long enough to say more is there, short enough to leave the item under it readable.24px24px
fade-contentThe fade where content is cut (mask-fade-t, mask-fade-b): a long message folded, a glimpse of hidden history. About two lines, so the cut reads as a fold, not a clipped line.48px48px
TokenLightDark
opacity-dimmedSomething present but not active: deleted, offline or still pending (opacity-dimmed). The place a dragged item came from keeps its own 0.4 (data-drag-origin).0.60.6

Tokens defined in styles.css

These are Tailwind theme values in styles.css, not entries in tokens.json, so they have no generated table.

TokensOwner
radius-sticker, radius-chip, radius-control, radius-container, radius-dialogShape
text-hero to text-label, text-mono-meta, text-mono-code, text-control, each with a phone and a desktop valueTypography
ease-slideMotion
spacing-timeline-message, spacing-timeline-section, spacing-timeline-row (the timeline tokens as spacing utilities) and spacing-timeline-turn, spacing-timeline-lead, spacing-timeline-start, spacing-timeline-end, derived from them. Products use only timeline-start and timeline-endSpacing
font-sans, font-heading, font-monoTypography

Former names

The names tokens had before the current ones were deprecated aliases up to raft-ui 0.56 and are removed after it. The codemod below still rewrites them, so code written against an older raft-ui can move in one step. The renames follow a few patterns:

text
primary-*                  ->  brand-*
accent-*                   ->  attention-*
color-brutal-{color}-{n}   ->  palette-{color}-{n}   (purple -> lavender)
secondary-{n}              ->  palette-stone-{n}
layer-panel                ->  layer-canvas
layer-canvas-muted         ->  layer-sidebar
layer-inset                ->  fill-muted
layer-hud-foreground       ->  foreground-on-hud
foreground-strong          ->  foreground
foreground-icon            ->  foreground-muted
foreground-placeholder     ->  foreground-hint
line                       ->  line-seam
line-muted                 ->  line-hairline
theme-shadow-float/lg/xl   ->  elevation-float       (utility: shadow-float)
theme-shadow-sticker       ->  elevation-sticker     (utility: shadow-sticker)
theme-focus-ring           ->  focus-ring            (utility: shadow-focus)
theme-shadow-xs/sm/md      ->  none: controls cast no shadow, drop the class

One former utility name is still declared because an app uses it: bg-fill-row-hover, which paints fill-subtle. Use bg-fill-subtle.

The codemod

raft-ui ships a codemod that rewrites the old names in Tailwind utilities (bg-…, hover:border-…/50) and in CSS custom properties (var(--…)):

sh
node node_modules/@botiverse/raft-ui/codemods/token-names.mjs <dir-or-file>... [--dry]
  • It rewrites .ts, .tsx, .js, .jsx, .mjs, .cjs, .css and .html files, and skips node_modules, dist and build. --dry lists the files it would change.
  • It renames references and leaves declarations alone, so running it twice is safe.
  • Review the result by hand. A guard that forbade an old name (a lint rule, a test, an allowlist) now forbids the new one, and a pattern built from parts, such as a regular expression over class names, keeps the old name.
  • The docs never use a deprecated name: scripts/check-docs.mjs fails a page that names a token in the deprecated group.

Changing a token

  • Add or change a value only in tokens.json, then regenerate foundation.css in the same change.
  • Give a new token a name that follows the grammar above, and add its utility to styles.css if components need one.
  • Add a component token only if it passes the rule in Component tokens, with a description that says why the web and the apps share it.
  • Rename a token by keeping the old name in the deprecated group, pointing at the new one, and adding the rename to the codemod. Remove aliases only in a release that lists breaking changes (before 1.0, a minor version), once no app uses them.
  • When a text, surface or tint value changes, recheck the contrast guarantees in Color for both modes.
  • Update the foundation page that owns the token in the same pull request (Authoring).
  • Color: what each color token is for, and the contrast it guarantees.
  • Typography: the type styles and the metric tokens.
  • Elevation: shadows and the focus ring.
  • Dark mode: what changes between the modes.