Skip to content
DireWork

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 tokens

This writes four committed files:

OutputConsumed by
apps/web/src/tokens.generated.cssThe web app, imported by apps/web/src/index.css
apps/web/src/tokens.generated.tsThe 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.cssThe docs site, imported by apps/fumadocs/src/app/global.css
apps/fumadocs/src/app/(home)/_widgets/overlay-themes.generated.tsLanding-page theme gallery
packages/overlay-kit/src/share-card-colors.generated.tsThe 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 (#236fea dark / #105fd9 light) is the fill behind white labels (primary buttons, avatar, checked states); --link (#6bb0ff dark / #004abb light) 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 uses text-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 --primary edge, a primary/10 wash and a --link label on a neutral bg-muted track (segmentedTrack / segmentedItem in ui/tabs.tsx). Pending edits wear the amber UnsavedDot from the same file.
  • Secondary accent: Cornflower (--cornflower).
  • Twitch: #9146FF is 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 use tabular-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.jsonCSS variablesNotes
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-3xsSteps 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-headerPage widths and the sticky header height
z--z-{save-bar,header,skip-link}Stacking order
color.brand, color.semantic, color.partner.{discord,obs}noneHex 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:

NamespaceVariable patternExample
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-liveTwitch actions / live state
Surface--bg-base / --bg-surface / --bg-elevvar(--background) / var(--muted) / var(--card)
Text--txt-1 / --txt-2, --hairlinevar(--foreground) / var(--muted-foreground)
Fonts--font-display / --font-body / --font-monoMontserrat / Plex Sans / Plex Mono
Radius--dw-radius-control9px — 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.

ClassPurpose
dw-display / dw-monoMontserrat heading + Plex Mono label styles
dw-text-1 / dw-text-2 / dw-text-brandText hierarchy
dw-bg-base / dw-bg-surface / dw-bg-elevSurfaces
panel / panel-hero / panel-insetFlat instrument panels (workhorse / gradient hero / recessed well)
console-label / console-ruleMono section label + labeled hairline rule
dw-chip + dw-chip-{accent,live,warn}LED-style status chips
dw-kicker + dw-kicker-numNumbered section kicker (01 · …)
dw-card / dw-card-hoverContent container
dw-btn + dw-btn-{primary,secondary,twitch,ghost}Buttons
dw-pillMetadata / trust chip
dw-codeCode well
bg-grain / bg-checkerModule grain / OBS transparency preview
preview-scene-dark / -light / -brightTheme Center preview backdrops (simulated stream scenes)
dw-reveal-{1,2,3} / animate-led-pulseStaggered 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/.

SpecComponentSource
account-menu.mdAccount Menuaccount-menu.tsx
alert-dialog.mdAlert Dialogui/alert-dialog.tsx
app-toaster.mdApp Toasterapp-toaster.tsx
auto-scale.mdAuto Scaleauto-scale.tsx
blocked-viewers-card.mdBlocked Viewers Cardbot-settings/blocked-viewers-card.tsx
bot-account-card.mdBot Account Cardbot-settings/bot-account-card.tsx
bot-console-card.mdBot Console Cardbot-settings/bot-console-card.tsx
bot-page-handoff.mdBot Page Handoffbot-page-handoff.tsx
bot-live-controls.mdBot Live Controlsbot-settings/bot-live-controls.tsx
bot-section-nav.mdBot Section Navbot-settings/bot-section-nav.tsx
bot-settings-skeleton.mdBot Settings Skeletonbot-settings-skeleton.tsx
button.mdButtonui/button.tsx
byte-budget.mdByte Budgetbyte-budget.tsx
callout.mdCalloutui/callout.tsx
card.mdCardui/card.tsx
chat-bubble.mdChat Bubble (ChatCommandWidget)apps/fumadocs/src/app/(home)/_widgets/ChatCommandWidget.tsx
collapsible.mdCollapsibleui/collapsible.tsx
color-input.mdColor Inputtheme-center/color-input.tsx
command-alias-editor.mdCommand Alias Editorbot-settings/command-alias-editor.tsx
command-reference.mdCommand Referencebot-settings/command-reference.tsx
command-table.mdCommand Tablebot-settings/command-table.tsx
confirm-dialog.mdConfirm Dialogconfirm-dialog.tsx
console-rule.mdConsole Ruleconsole-rule.tsx
count-badge.mdCount Badgecount-badge.tsx
dashboard-skeleton.mdDashboard Skeletondashboard-skeleton.tsx
dashboard-stats.mdDashboard Statsdashboard-stats.tsx
dev-login-button.mdDev Login Buttondev-login-button.tsx
dropdown-menu.mdDropdown Menuui/dropdown-menu.tsx
field-row.mdField Rowtheme-center/field-row.tsx
font-gate.mdFont Gatefont-gate.tsx
font-select.mdFont Selecttheme-center/font-select.tsx
header.mdHeaderheader.tsx
icon-picker.mdIcon Pickertheme-center/icon-picker.tsx
input.mdInputui/input.tsx
label.mdLabelui/label.tsx
loader.mdLoaderloader.tsx
loading-status.mdLoading Statusloading-status.tsx
message-editor.mdMessage Editorbot-settings/message-editor.tsx
mode-toggle.mdMode Togglemode-toggle.tsx
obs-sources.mdOBS Sourcesobs-sources.tsx
overlay-icon.mdOverlay Iconoverlay-icon.tsx
overlay-query-provider.mdOverlay Query Provideroverlay-query-provider.tsx
page-header.mdPage Headerpage-header.tsx
phase-labels-editor.mdPhase Labels Editortheme-center/phase-labels-editor.tsx
progressive-section.mdProgressive Sectionprogressive-section.tsx
providers.mdProvidersproviders.tsx
query-error.mdQuery Errorquery-error.tsx
save-bar.mdSave Barsave-bar.tsx
setup-checklist.mdSetup Checklistsetup-checklist.tsx
secret-url-row.mdSecret URL Rowsecret-url-row.tsx
section-group.mdSection Groupsection-group.tsx
settings-card.mdSettings Cardbot-settings/settings-card.tsx
select.mdSelectui/select.tsx
skeleton.mdSkeletonui/skeleton.tsx
slider.mdSliderui/slider.tsx
sonner.mdToaster (Sonner)ui/sonner.tsx
status-chip.mdStatus Chipstatus-chip.tsx
stream-scene.mdStream Scenestream-scene.tsx
style-field-groups.mdStyle Field Groupstheme-center/style-field-groups.tsx
style-preview-panel.mdStyle Preview Paneltheme-center/style-preview-panel.tsx
style-sections-editor.mdStyle Sections Editortheme-center/style-sections-editor.tsx
styles-skeleton.mdStyles Skeletonstyles-skeleton.tsx
switch.mdSwitchui/switch.tsx
tabs.mdTabsui/tabs.tsx
task-card.mdTask Card (TaskListDisplay)task-list-display.tsx
task-list-widget.mdTask List Widget (docs mock)apps/fumadocs/src/app/(home)/_widgets/TaskListWidget.tsx
task-manager.mdTask Managertask-manager.tsx
task-style-editor.mdTask Style Editortheme-center/task-style-editor.tsx
theme-browser.mdTheme Browsertheme-center/theme-browser.tsx
theme-card.mdTheme Cardtheme-center/theme-card.tsx
theme-color-sync.mdTheme Color Synctheme-color-sync.tsx
theme-provider.mdTheme Providertheme-provider.tsx
theme-swatch.mdTheme Swatch (OverlayThemePreview)apps/fumadocs/src/app/(home)/_widgets/OverlayThemePreview.tsx
timer-controls.mdTimer Controlstimer-controls.tsx
timer-overlay-widget.mdTimer Overlay Widget (docs mock)apps/fumadocs/src/app/(home)/_widgets/TimerOverlayWidget.tsx
timer-ring.mdTimer Ring (TimerDisplay)timer-display.tsx
timer-style-editor.mdTimer Style Editortheme-center/timer-style-editor.tsx
tooltip.mdTooltipui/tooltip.tsx
twitch-icon.mdTwitch Iconicons/twitch-icon.tsx
unsaved-changes-guard.mdUnsaved Changes Guardunsaved-changes-guard.tsx
user-menu.mdUser Menuuser-menu.tsx
version-badge.mdVersion Badgeversion-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 specDocumentedReplaced by
button.md (old content)dw-btn classesbutton.md, now the ui/button.tsx primitive
card.md (old content)dw-card, dw-card-hovercard.md, now the ui/card.tsx primitive
pill.mddw-pillstatus-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.