OpenProgram Docs

Design tokens

A component names a tier and never writes a value. Tiers live in apps/web/app/styles/design/; npm run check fails on anything written by hand. A value that fits no tier is a design change: add the tier or the table row first.

Files

FileHolds
globals.cssEntry: tailwindcss, then design, themes, styles
design/layout.cssRail widths, chat column, drag surface
design/controls.cssControl height tiers, list row, button corner
design/composer.cssThe input box's own geometry
design/type.cssType tiers, font stacks
design/shape.cssSpacing unit, radius tiers
design/color.cssAccent family, the four text inks, fixed interface colours
design/icons.cssIcon size tiers
design/motion.cssDurations, the easing
design/layers.cssStacking layers (z-index)
design/shadcn.cssshadcn's colour names to the app's roles
design/tailwind.cssTailwind's scan paths, variants, utility names
themes/Colour values, one file per theme and a fallback
base/Document, focus, list row, shell layout, scrollbar, sidebar, desktop chrome, motion
chat/, right-dock/, dag/Global styles of those areas

Paths under apps/web/app/styles/ except globals.css. Component styles sit beside their component in *.module.css, read tokens and add no values.

Control heights

TierHeightTokenButton sizeFont
inline20px--ui-control-inlineNoneNone
row24px--ui-button-h-xsxs, icon-xs12px
menu28px--ui-button-h-smsm, icon-sm13px
standard30px--ui-button-hdefault, icon14px
composer32px--ui-button-h-lglg, icon-lg14px
choice26px--ui-choice-hAn option inside a 32px choice groove13px

--ui-button-h is --ui-list-h: an ordinary button is as tall as a sidebar chat row.

  • A Button picks its tier through size, never a height class. A control from class strings takes h-(--ui-button-h…) or size-(--ui-button-h…); the Nova test scans every .ts and .tsx file.
  • A hand-written stylesheet button sets height, and width when square, to a tier token; the test scans every stylesheet.
Which component sits in which tier
tiercomponents
inline 20controls drawn inside another control: the center tab's ×, the image annotator's colour swatches, the remove badge on a Launchpad tile, a new-tab shortcut tile and an image chip, the tool switch on a function card, the secret-reveal toggle in a user bubble
row 24, chatactions that sit on a row, card or message: the sidebar chat row's ⋯, message hover actions (copy, retry …), queued-message actions, attachment remove and preview close, the composer popover's close, the fast toggle in the effort pill, the Mermaid source toggle, the annotate button on an image tile
row 24, browser and filesthe find bar's arrows, the address bar's star, the diff hunk and line-comment buttons, session-resource row actions, branch row actions, bookmark actions, the split picker's close, the DAG zoom readout, the file search's match-mode segment
row 24, catalogs and settingsthe project editor's remove, the Agent catalog's required toggle, settings and avatar colour swatches, the sidebar's project actions (pin, new chat, options) and refresh, the recents filter, the Agents view menu, the skill catalog's install button, ManageIconButton row actions and RailAction, provider account and model rows, an application row's ⋯, an Agent card's menu
menu 28, chat and tabsrows in a menu or popover (itemCls), and compact controls in toolbars and chip rows: the composer's environment chips (Local, channel, folder) and corner menu buttons, the mic and send buttons, top-bar chips and menu triggers, center tabs and the tab strip's + / overview / menu buttons, the transcript's view controls, function-card "Use", function-form chips
menu 28, tool surfacesthe built-in browser toolbar, download and find pills, terminal actions, the PiP title bar buttons, Review's menu and pagination, the DAG tool rail, Programs' view switch, Memory's view switch, file-panel and settings icon buttons
menu 28, inputsinputs that sit in a menu or toolbar: the command palette's search, the git menu's input, a bookmark's title, Launchpad's search, the file search options, the DAG selection actions
standard 30every other Button, input, select, toggle group and search field — page headers, cards, dialogs (the confirm dialog's Cancel / confirm), settings rows, Agents, Applications, Projects, the folder picker; sidebar rows and sidebar icon buttons (ui-list-item); the PDF toolbar; the message editor's buttons
composer 32the composer's corner buttons (--composer-button-size), the effort pill, the function form's inputs, and the canvas control tiles

Not tiered (listed as exemptions in apps/web/tests/ui/ui-kit-is-nova.test.mjs): the account footer row (64px), Agents settings width handle (20 x 44px), center tab's active state (28px and its 6px foot), the tab strip drawing in the effects preview, the browser action cue, label tags, the Switch (Nova's 32 x 18.4px track), switch knobs, icon glyph sizes.

Type

TierSizeLineTokenTailwind
2xs11px16px--fs-2xstext-fs-2xs
xs12px16px--fs-xstext-fs-xs
sm13px18px--fs-smtext-fs-sm
base14px20px--fs-basetext-fs-base
chat15px24px--fs-chattext-fs-chat
md16px24px--fs-mdtext-fs-md
title18px28px--fs-titletext-fs-title
lg20px28px--fs-lgtext-fs-lg
display30px36px--fs-displaytext-fs-display
  • CSS writes font-size: var(--fs-*), class strings text-fs-*, inline styles fontSize: "var(--fs-*)". Never a px or rem literal, an arbitrary text-[…], or stock text-xs to text-2xl. @theme still maps stock names to the shadcn docs' meaning so pasted registry code renders right.
  • Weights: 400 body, 500 labels, controls and row titles, 600 titles and emphasis, 700 transcript headings only.
Which text sits on which tier
tiertext
2xs 11counters and dots in a badge, tab counts, kbd hints in the PiP, uppercase group labels on detail pages, DAG node and panel meta, context-commit timeline meta, folder sizes, the attachment strip's size line, the composer chips' small hints, model-list tags
xs 12secondary meta beside or under a row: timestamps, paths, counts, the account footer's subtitle; menu section labels, menu notes and key hints (GROUP_LABEL, MENU_NOTE, SHORTCUT); field descriptions; xs (24px) Buttons
sm 13descriptions and helper text, center tabs, page tab pills (manage-page tabs, project tabs), Agent card text and pills, sm (28px) Buttons and toggles, settings labels in dialogs
base 14body text; sidebar and list rows; menu and Select rows (itemCls); default (30px) and lg (32px) Buttons, inputs, textareas, selects, toggles; dialog descriptions; card titles in grids
chat 15transcript copy, the composer's input, embedded conversation cards, the running panel title, the Markdown file preview
md 16section headings inside a page (Settings card titles, "All chats"), dialog titles, Markdown h3/h4
title 18the page title in the header (manage-page), the title of a detail pane: Settings detail, Programs entry, Agent editor, Project, Memory editor; Markdown h2
lg 20the sidebar wordmark, big figures (usage totals), glyph tiles (project icons), the effects preview, Markdown h1
display 30the Launchpad folder title

Spacing and radius

Tailwind's spacing unit is 4px on every surface (p-2 = 8px), because the default 0.25rem lands on half pixels on the 14px root. Hand-written CSS uses whole px multiples where it can.

TierSizeUsed by
2xs2pxHairline bars, progress tracks, carets, a tip's arrow
xs4pxTags, kbd, checkboxes, inline code, badges
sm6pxChips and small controls inside a row
md8pxEvery Button size, inputs, selects, hand-written buttons
lg10pxList rows, menus, popovers, Select popups, cards
xl12pxThe centre card, split panes, page panels, dialogs
2xl16pxUser bubbles, large floating surfaces
groove11pxA choice groove: md plus the 3px around its face
full9999pxPills, avatars, dots

Same names in CSS (var(--radius-lg)) and Tailwind (rounded-lg). --ui-button-radius is md, --ui-list-radius lg. A share of the box (50%, a squircle's 26%) and a concentric calc() over a tier are allowed. A radius from a surface with no tier says so with a shape: comment.

Text inks

inktext
--text-brighttitles, the hovered or selected row, values
--text-primarybody text, list rows, controls
--text-secondarydescriptions, helper text, inactive tabs, counts
--text-mutedmeta (timestamps, paths, placeholders), disabled text

Tailwind: text-text-bright, -primary, -secondary, -muted. Parts in components/ui keep text-foreground and text-muted-foreground, which resolve to the same inks; other code does not use those. Accents (--accent-*, --theme-accent) mark state, never hierarchy.

Interface colours

Theme colours live in themes/. A colour the same in every theme is a named token in color.css on :root; components name the token. light-dark(a, b) follows the using element's color-scheme.

Token groups
grouptokensused by
session status--status-working --status-needs-input --status-failed --status-unread --status-refresh-donethe sidebar's session markers, the refresh flash
permission tiers--permission-deny --permission-ask --permission-allowthe project permissions dots
error text--error-form --error-message-edit --error-documentplugin dialogs, the message editor, the document window
catalog pills--pill-warn --pill-dangerthe skills catalog's hover tints
commit timeline--commit-state-* (-bg and ink per state), --commit-error, --commit-anchor, --commit-refresh-donethe context commit timeline
ANSI--ansi-red --ansi-green --ansi-yellow --ansi-blue --ansi-magenta --ansi-cyana program's progress log
ink on fill--ink-on-fill, --avatar-fallback-bgtext on a coloured fill (snap label, Save, count badge, active colour well, letter avatar)
agent cursor--agent-cursor-keyline --agent-cursor-shadow --agent-light-pulsethe agent cursor and the controlled-app lights
browser--browser-control-surface --browser-control-ink, --browser-pane-active --browser-pane-yielding, --browser-glyph-*the browser-control chip, the browser tab's pane outlines and home glyph
canvas controls--pane-light-<em>, --pane-divider-</em>a pane's window lights and the split divider
scrim--scrim-attachment-previewan enlarged message attachment
PDF preview--pdf-viewport-bg --pdf-thumb-shadow --pdf-thumb-currentthe PDF page well and thumbnails
GUI tool--gui-tool-rulethe hairlines of a GUI tool's activity card
sidebar--nav-toggle-press --nav-item-press --new-chat-chip --new-chat-chip-hover --wordmark-from --wordmark-topressed nav rows, the New chat chip, the wordmark
provider card--provider-card-highlighta provider's model card
theme scenes--theme-scene-rain-<em> --theme-scene-gradient-</em>the Code rain and Gradient previews in Settings, the Gradient scene and its glass chrome behind Launchpad
Launchpad--launchpad-*the shadows under app icons and an open folder, the edit-mode remove badge, the label shadow on the Gradient scene
running glow--running-glow-blue --running-glow-violet --running-glow-greenthe flowing glow on a running conversation's sidebar row
branch lanes--lane-0 … --lane-17the conversation graph's lines, nodes and tags, the Activity panel's branch rows, the browser's new-tab tile initials (lib/format-utils/lane-colors.ts hands out var(--lane-N))
code highlighting--hl-keyword --hl-string --hl-number --hl-comment --hl-title --hl-type --hl-attrhighlight.js tokens in a message's code block

Step tones in styles/tool-tones.css (--tool-tone-*, --timeline-*) are the same kind of token.

  • Every shadcn role is a full colour: read var(--ring). Wrapping in hsl() resolves invalid. Translucent: color-mix(in srgb, var(--muted) 34%, transparent).
  • var(--role, literal) names an always-defined role (theme roles, --accent, --destructive, --muted-foreground) with no dead literal. A role no theme defines (--danger, --warning, --success, --red, --orange, --status-error, --border-color) is replaced by the token holding its literal.

Icons

sizewhere
12inside xs (24px) controls, beside 11–12px text
14inside sm (28px) controls, menu rows, chips
16default controls, toolbars, page buttons
20sidebar navigation, empty states, tiles, page-header glyphs
24hero glyphs on empty pages

A size of 28 and up is an illustration (avatar, logo).

Motion

tiervaluewhere
--motion-fast120mshover, press, colour and border changes
--motion-medium160msreveals, fades, small movements
--motion-slow240mspanels, drawers, larger movements

transition: opacity var(--motion-medium) var(--ease-standard). --ease-standard is the one easing. The face in a choice groove has its own slide (see Surface system). Looping animations and spring curves keep their timing. A script waiting on a transition times out no sooner than its tier.

Shadows

TokenFor
--shadow-smCards, small raised parts
--shadowRaised panels
--shadow-popoverMenus, floating bars, drag previews
--shadow-dialogDialogs, full-window overlays
--shadow-raised, --shadow-raised-hoverThe input box, elevated buttons. The hover shadow is three layers: a faint even ambient that shows the top edge, a tight contact shadow and a soft drop. Dark themes add a 6% white highlight inside the top edge. No outline.
--shadow-grooveA faint inset shadow on --groove (bg-groove): the groove of a choice control, a step below the surface in light themes and the deep page in dark ones

Never an rgba in a component. Inset lines and focus rings are borders, not elevation.

Layers

layervaluewhat
--z-sticky20sticky headers inside a pane
--z-floating50panels floating inside a pane
--z-drawer100sidebars laid over the content at narrow widths
--z-overlay110the dim layer behind a dialog
--z-dialog120Dialog, AlertDialog
--z-popover130Popover, DropdownMenu, ContextMenu, Select, above dialogs
--z-tooltip140Tooltip
--z-toast300toasts
--z-fullscreen10000full-window editors and lightboxes
--z-drag100000drag previews and the drag surface

Values 1 to 12 inside one component stay local. Tailwind: z-(--z-popover). CSS: z-index: var(--z-popover), or calc(var(--z-drag) + 1) for a part just above its layer.

Which layer writes what

LayerWritesNever
shadcn parts in components/uievery control: button, input, select, menu, dialog, switch, checkbox—
Tailwind classes in the JSXlayout and spacing (flex, grid, gap, padding, size), simple statescomplex selectors
*.module.css next to the componentwhat Tailwind cannot say: pseudo-elements (the project guide line), data-* and parent selectors, keyframes, layered cascadesa hand-made control, a literal value
Layout rules still in modules

About 280 one-class, layout-only rules remain. A Tailwind utility sits in @layer utilities and a module rule is unlayered, so a moved rule loses to every unlayered rule on the element.

A rule stays when its class appears earlier in the stylesheet, the element merges its own classes (a DialogContent keeps sm:max-w-*), another module class sets one of the same properties, or the styles object is re-exported or passed whole. They move when their component is edited; the guard makes sure the number only goes down.

The guard

apps/web/scripts/ui/check-design-tokens.mjs, run by npm run check, scans every stylesheet and .ts or .tsx file. apps/web/tests/ui/ui-kit-is-nova.test.mjs refuses a literal control height.

KindRefused
FontSize off the --fs-* tiers, arbitrary text-[…], stock text-xs to text-2xl, a font named by hand, the font shorthand, forced tabular-nums (Settings owns typeface and digits)
WeightAnything but 400, 500, 600, 700
Radiuspx, arbitrary rounded-[…], bare rounded, rounded-3xl and up, --radius, a --radius-* that is not a tier
Ink--text-tertiary, --text-dim, text-[var(--text-*)], shadcn ink names outside components/ui
IconA size below 28 that is not a tier
Colour#hex, rgb(), hsl() outside app/styles/themes/, app/styles/design/ and custom-property lines in app/styles/
Module layoutMore layout-only rules than apps/web/scripts/ui/module-layout-baseline.json allows; a new module may have none. node apps/web/scripts/ui/check-design-tokens.mjs --write-layout-baseline lowers the numbers
Named exceptions
  • APIs that take pixels: xterm, Mermaid, canvas, Electron views.
  • Framer Motion's numeric radius on the Agent cards.
  • The input box: its radii, weights and icons stay as drawn.
  • A line that says glyph:, shape: or mask:.
  • COLOUR_DATA: user-picked palettes and chart series, artwork (Launchpad and memory icons, code rain, search-provider glyphs), APIs taking a colour string (canvas, WebGL, xterm, Mermaid, pdf.js, the web manifest), the effort heat scale computed as hsl().
Last updated · 2026-11-25