Design System
DireWork's design tokens, the dw-* utility layer, and shared UI primitives.
DireWork ships a small design system so the web app, the docs site, and the OBS overlays all speak the same visual language. design-system/tokens.json is the source of truth: it generates the color, radius, type, motion, and layout CSS for both the app and the docs site, the landing-page theme gallery, and holds the squircle radius.
Source of truth
design-system/
tokens.json # the tokens — edit this
scripts/render.ts # pure renderers (tokens → CSS / TS strings)
scripts/generate.ts # writes the generated files
README.md # full reference
components/ # one spec per component (README = index + page map)Regenerate the outputs from the repo root:
bun run tokensThis writes four committed files:
| Output | Consumed by |
|---|---|
apps/web/src/tokens.generated.css | The web app, imported by apps/web/src/index.css |
apps/web/src/tokens.generated.ts | The web app's manifest, theme-color tags and crash page: SCHEME_HEX, a few palette colors as sRGB hex for where a CSS variable can't reach |
apps/fumadocs/src/app/tokens.generated.css | The docs site, imported by apps/fumadocs/src/app/global.css |
apps/fumadocs/src/app/(home)/_widgets/overlay-themes.generated.ts | Landing-page theme gallery |
packages/overlay-kit/src/share-card-colors.generated.ts | The social share card (both sites): the dark palette and blue accent as hex |
Never edit a generated file by hand: change tokens.json, run bun run tokens, and commit both. CI checks for drift with bun run tokens && git diff --exit-code, and a web unit test (design-tokens.test.ts) fails if a committed CSS file or a hex module doesn't match what tokens.json renders. A second test (tokens-contrast.test.ts) checks every app color pairing (text, status chips, input borders, focus ring, controls, chart marks) in both themes at its chosen WCAG level: AAA (7:1) for body, muted and link text and the dark status tones, AA (4.5:1) for white on the blue and Twitch fills, red and the light status tones, and 3:1 for non-text. design-system/contrast.md lists each pairing and why.
Shared overlay geometry and clock formatting (roundedRectPath, roundedRectPerimeter, formatClock, SQUIRCLE_RADIUS) live in the workspace package @dirework/overlay-kit (packages/overlay-kit), used by both the real OBS overlays and the docs mocks. A unit test in the web app keeps tokens.json in sync with the Theme Center presets and SQUIRCLE_RADIUS.
Neutral dark
The visual language is a conventional neutral dark UI, the kind GitHub, Vercel and
Linear ship: near-black zinc surfaces with no color cast (background #0c0c0e, cards
#151518), off-white text (#ededef) and muted gray secondary text (#b3b3bc). Light
mode is fully supported (#fafafa page, white cards, the same blue). The console grammar
stays: panels, mono uppercase labels, LED-style status chips.
- Accent blue, two forms:
--primary(#236feadark /#105fd9light) is the fill behind white labels (primary buttons, avatar, checked states);--link(#6bb0ffdark /#004abblight) is the text form (links, icons, active nav) and clears 7:1 on every plain surface and inline-code background. Focus rings use--ring. No single blue works both under white text and as text on near-black, so text always usestext-link. - Selected: every segmented control (the tab lists, the Theme Center's preview toggle,
the bot page handoff) marks its selected segment one way in both themes: a
--primaryedge, aprimary/10wash and a--linklabel on a neutralbg-mutedtrack (segmentedTrack/segmentedIteminui/tabs.tsx). Pending edits wear the amberUnsavedDotfrom the same file. - Secondary accent: Cornflower (
--cornflower). - Twitch:
#9146FFis reserved for "Sign in / Connect with Twitch" actions only. - Phase colors: work = emerald
#34C759, break = blue, long break = cornflower, paused = amber#FF9F0A. - State: emerald = live / connected, amber = paused / warning (LED-style chips).
Type:
- Display / headings: Montserrat (
--font-display) - Body: IBM Plex Sans (
--font-body) - Labels & numerals: IBM Plex Mono (
--font-mono) — timer digits usetabular-nums
Tokens
Each generated stylesheet declares the palette as plain CSS variables on :root (light) and .dark (dark; the docs copy also follows the OS preference before a theme class is set) and registers them with Tailwind, so bg-background, text-muted-foreground, bg-twitch, rounded-2xl, text-2xs, tracking-label and friends all read the same values.
Group in tokens.json | CSS variables | Notes |
|---|---|---|
color.scheme.{light,dark} | --background, --primary, --success, --border, --hairline, --cornflower, --chart-*, --sidebar-*… | The UI palette, as oklch values. {name} aliases another key (--chart-2: var(--cornflower)). |
color.phase | --phase-{work,break,long-break,paused} | Timer phase accents |
color.obs | --color-obs-* (bg-obs-window, text-obs-green…) | The bot dock's OBS Yami palette (status LED included), app only; the bot page notices use the scheme tokens in .dark |
color.partner | --twitch, --twitch-hover (bg-twitch) | Twitch purple, for Twitch actions only |
radius | --radius + --radius-{xs…4xl} | App only, as offsets from --radius (12px) |
font.size, font.lineHeight | --text-2xs, --text-3xs | Steps Tailwind doesn't ship; the rest are Tailwind's defaults, listed for reference |
tracking | --tracking-{chip,label,eyebrow,display,marquee} | Letter-spacing for chips, labels, display caps |
motion | --ease-console, --animate-console-rise(-fast) | Plus the console-rise keyframes |
layout | --container-{content,editor}, --spacing-header | Page widths and the sticky header height |
z | --z-{save-bar,header,skip-link} | Stacking order |
color.brand, color.semantic, color.partner.{discord,obs} | none | Hex palette for OG images and docs widgets |
The docs stylesheet (apps/fumadocs/src/app/global.css) maps the generated palette onto the names the docs surfaces read, and keeps a few docs-only values by hand:
| Namespace | Variable pattern | Example |
|---|---|---|
| Fumadocs | --color-fd-* | --color-fd-background: var(--background) |
| Brand | --brand-500 / --brand-600 / --brand-50 | --brand-500: var(--primary) (accent fill), --brand-600: var(--link) (accent text) |
| Phase | --phase-{work,break,long-break,paused} | timer ring + status accents |
| Partner | --color-twitch, --color-live | Twitch actions / live state |
| Surface | --bg-base / --bg-surface / --bg-elev | var(--background) / var(--muted) / var(--card) |
| Text | --txt-1 / --txt-2, --hairline | var(--foreground) / var(--muted-foreground) |
| Fonts | --font-display / --font-body / --font-mono | Montserrat / Plex Sans / Plex Mono |
| Radius | --dw-radius-control | 9px — pills, chips, kickers, buttons |
The console classes (panel, panel-hero, panel-inset, console-label, console-rule, bg-grain) are generated into both files from one body, so the app and the docs cannot drift; the docs edge them with the lighter --hairline. Fonts stay hand-written in both stylesheets because they wrap the next/font variables. The docs copy carries no radius scale: fumadocs-ui compiles its own rounded-* utilities against the docs theme, so overriding it would restyle every fumadocs component.
The dw-* utility layer
The marketing and docs surfaces use a thin set of utility classes (defined in
apps/fumadocs/src/app/global.css) that read the tokens. They keep the landing page
token-backed without pulling in a component framework.
| Class | Purpose |
|---|---|
dw-display / dw-mono | Montserrat heading + Plex Mono label styles |
dw-text-1 / dw-text-2 / dw-text-brand | Text hierarchy |
dw-bg-base / dw-bg-surface / dw-bg-elev | Surfaces |
panel / panel-hero / panel-inset | Flat instrument panels (workhorse / gradient hero / recessed well) |
console-label / console-rule | Mono section label + labeled hairline rule |
dw-chip + dw-chip-{accent,live,warn} | LED-style status chips |
dw-kicker + dw-kicker-num | Numbered section kicker (01 · …) |
dw-card / dw-card-hover | Content container |
dw-btn + dw-btn-{primary,secondary,twitch,ghost} | Buttons |
dw-pill | Metadata / trust chip |
dw-code | Code well |
bg-grain / bg-checker | Module grain / OBS transparency preview |
preview-scene-dark / -light / -bright | Theme Center preview backdrops (simulated stream scenes) |
dw-reveal-{1,2,3} / animate-led-pulse | Staggered entrance + LED pulse |
Component catalog
Every component has one spec under design-system/components/: each module in
apps/web/src/components/ (the ui/ primitives, the shared components, and the
theme-center/, bot-settings/ and icons/ folders), plus every docs landing widget (the .tsx files in apps/fumadocs/src/app/(home)/_widgets/). A
spec opens with source: (the file it documents) and tokens: (the tokens.json families
it reads) frontmatter, then Purpose, Anatomy, Props and variants, States, Accessibility
(including the roles and names the e2e tests pin), and Do / Don't. The catalog's
README.md maps each page to the components it renders.
apps/web/src/lib/__tests__/spec-catalog.test.ts keeps the catalog honest: every source:
must exist, every component file must be claimed by exactly one spec, every spec must have a
row below whose Source matches its source:, sit in one README catalog group and in the
README page map, and the "Pinned values" tables in timer-ring.md and task-card.md must
quote every leaf of DEFAULT_TIMER_STYLES / DEFAULT_TASK_STYLES and every
lib/overlay-view.ts constant. Renaming a component or changing or adding an overlay
default fails CI until its spec moves with it.
Sources are relative to apps/web/src/components/ unless they start with apps/.
| Spec | Component | Source |
|---|---|---|
account-menu.md | Account Menu | account-menu.tsx |
alert-dialog.md | Alert Dialog | ui/alert-dialog.tsx |
app-toaster.md | App Toaster | app-toaster.tsx |
auto-scale.md | Auto Scale | auto-scale.tsx |
blocked-viewers-card.md | Blocked Viewers Card | bot-settings/blocked-viewers-card.tsx |
bot-account-card.md | Bot Account Card | bot-settings/bot-account-card.tsx |
bot-console-card.md | Bot Console Card | bot-settings/bot-console-card.tsx |
bot-page-handoff.md | Bot Page Handoff | bot-page-handoff.tsx |
bot-live-controls.md | Bot Live Controls | bot-settings/bot-live-controls.tsx |
bot-section-nav.md | Bot Section Nav | bot-settings/bot-section-nav.tsx |
bot-settings-skeleton.md | Bot Settings Skeleton | bot-settings-skeleton.tsx |
button.md | Button | ui/button.tsx |
byte-budget.md | Byte Budget | byte-budget.tsx |
callout.md | Callout | ui/callout.tsx |
card.md | Card | ui/card.tsx |
chat-bubble.md | Chat Bubble (ChatCommandWidget) | apps/fumadocs/src/app/(home)/_widgets/ChatCommandWidget.tsx |
collapsible.md | Collapsible | ui/collapsible.tsx |
color-input.md | Color Input | theme-center/color-input.tsx |
command-alias-editor.md | Command Alias Editor | bot-settings/command-alias-editor.tsx |
command-reference.md | Command Reference | bot-settings/command-reference.tsx |
command-table.md | Command Table | bot-settings/command-table.tsx |
confirm-dialog.md | Confirm Dialog | confirm-dialog.tsx |
console-rule.md | Console Rule | console-rule.tsx |
count-badge.md | Count Badge | count-badge.tsx |
dashboard-skeleton.md | Dashboard Skeleton | dashboard-skeleton.tsx |
dashboard-stats.md | Dashboard Stats | dashboard-stats.tsx |
dev-login-button.md | Dev Login Button | dev-login-button.tsx |
dropdown-menu.md | Dropdown Menu | ui/dropdown-menu.tsx |
field-row.md | Field Row | theme-center/field-row.tsx |
font-gate.md | Font Gate | font-gate.tsx |
font-select.md | Font Select | theme-center/font-select.tsx |
header.md | Header | header.tsx |
icon-picker.md | Icon Picker | theme-center/icon-picker.tsx |
input.md | Input | ui/input.tsx |
label.md | Label | ui/label.tsx |
loader.md | Loader | loader.tsx |
loading-status.md | Loading Status | loading-status.tsx |
message-editor.md | Message Editor | bot-settings/message-editor.tsx |
mode-toggle.md | Mode Toggle | mode-toggle.tsx |
obs-sources.md | OBS Sources | obs-sources.tsx |
overlay-icon.md | Overlay Icon | overlay-icon.tsx |
overlay-query-provider.md | Overlay Query Provider | overlay-query-provider.tsx |
page-header.md | Page Header | page-header.tsx |
phase-labels-editor.md | Phase Labels Editor | theme-center/phase-labels-editor.tsx |
progressive-section.md | Progressive Section | progressive-section.tsx |
providers.md | Providers | providers.tsx |
query-error.md | Query Error | query-error.tsx |
save-bar.md | Save Bar | save-bar.tsx |
setup-checklist.md | Setup Checklist | setup-checklist.tsx |
secret-url-row.md | Secret URL Row | secret-url-row.tsx |
section-group.md | Section Group | section-group.tsx |
settings-card.md | Settings Card | bot-settings/settings-card.tsx |
select.md | Select | ui/select.tsx |
skeleton.md | Skeleton | ui/skeleton.tsx |
slider.md | Slider | ui/slider.tsx |
sonner.md | Toaster (Sonner) | ui/sonner.tsx |
status-chip.md | Status Chip | status-chip.tsx |
stream-scene.md | Stream Scene | stream-scene.tsx |
style-field-groups.md | Style Field Groups | theme-center/style-field-groups.tsx |
style-preview-panel.md | Style Preview Panel | theme-center/style-preview-panel.tsx |
style-sections-editor.md | Style Sections Editor | theme-center/style-sections-editor.tsx |
styles-skeleton.md | Styles Skeleton | styles-skeleton.tsx |
switch.md | Switch | ui/switch.tsx |
tabs.md | Tabs | ui/tabs.tsx |
task-card.md | Task Card (TaskListDisplay) | task-list-display.tsx |
task-list-widget.md | Task List Widget (docs mock) | apps/fumadocs/src/app/(home)/_widgets/TaskListWidget.tsx |
task-manager.md | Task Manager | task-manager.tsx |
task-style-editor.md | Task Style Editor | theme-center/task-style-editor.tsx |
theme-browser.md | Theme Browser | theme-center/theme-browser.tsx |
theme-card.md | Theme Card | theme-center/theme-card.tsx |
theme-color-sync.md | Theme Color Sync | theme-color-sync.tsx |
theme-provider.md | Theme Provider | theme-provider.tsx |
theme-swatch.md | Theme Swatch (OverlayThemePreview) | apps/fumadocs/src/app/(home)/_widgets/OverlayThemePreview.tsx |
timer-controls.md | Timer Controls | timer-controls.tsx |
timer-overlay-widget.md | Timer Overlay Widget (docs mock) | apps/fumadocs/src/app/(home)/_widgets/TimerOverlayWidget.tsx |
timer-ring.md | Timer Ring (TimerDisplay) | timer-display.tsx |
timer-style-editor.md | Timer Style Editor | theme-center/timer-style-editor.tsx |
tooltip.md | Tooltip | ui/tooltip.tsx |
twitch-icon.md | Twitch Icon | icons/twitch-icon.tsx |
unsaved-changes-guard.md | Unsaved Changes Guard | unsaved-changes-guard.tsx |
user-menu.md | User Menu | user-menu.tsx |
version-badge.md | Version Badge | version-badge.tsx |
Legacy
Specs removed when the catalog moved to one spec per component. They documented the docs
site's dw-* utility classes rather than a component; the classes themselves are listed in
the dw-* table above.
| Removed spec | Documented | Replaced by |
|---|---|---|
button.md (old content) | dw-btn classes | button.md, now the ui/button.tsx primitive |
card.md (old content) | dw-card, dw-card-hover | card.md, now the ui/card.tsx primitive |
pill.md | dw-pill | status-chip.md (status-chip.tsx) |
Overlay themes
overlay.themes in tokens.json mirrors the 6 presets in apps/web/src/lib/theme-presets.ts, holding the four swatch colors each exposes (bg, accent, text, username). That data is generated into a typed module the landing-page gallery renders. When a preset's preview colors change, update tokens.json and run bun run tokens.
Accessibility rules
- Two themes, always. Every surface must read in light and dark.
- Never color alone. Done tasks use strike-through and a dimmed color.
- Honor reduced motion. Animated primitives stop under
prefers-reduced-motion: reduce. - Real interactive elements. Buttons and links are
<button>/<a>, never clickable<div>s.