Skip to content

Color theme

Where the colours come from

There are two token sets that describe the same palette:

Set File Format Read by
HSL variables tellyboard-frontend/src/index.css (:root, .dark) --background: 0 0% 98%; (H S L without hsl()) Tailwind (hsl(var(--primary))) and the --c-* aliases
Design tokens package design-tokens/dist/variables.css, tokens.js --c-primary-default: #0961aa; (hex) cv() and the exported tokens

index.css also defines --c-* aliases (--c-bg: hsl(var(--background)), --c-surface: hsl(var(--card)), --c-primary, ...) for both :root and .dark. @playtelly/tellyboard-theme exposes them as the C object (C.bg, C.surface, C.text, C.primary, C.border ...), which is what pages use in inline styles.

Semantic colours

Group Tokens (design-tokens names) Use
Background bg-base, bg-surface, bg-subtle, bg-overlay page, card, striped rows and inputs, modal backdrop
Border border-default, border-light, border-focus lines, dividers, focused input
Text text-default, text-secondary, text-muted, text-hint, text-disabled, text-onPrimary body, secondary, captions, labels, disabled, text on a primary button
Primary primary-default, -dark, -darker, -subtle, -border, -text actions and selection (#0961aa in light)
Success / Warning / Danger / Info <name>-default, -dark, -subtle, -border, -text statuses and alerts
Accent, Focus, Disabled accent-*, focus-ring, disabled-bg, disabled-text highlights, focus ring, disabled controls
Sidebar sidebar-bg, -foreground, -primary, -accent, -border the left navigation
Shadow shadow-sm, -md, -lg, -xl elevation

Light primary is hsl(207 90% 35%); the dark surfaces are hsl(210 20% 8%) (background) and hsl(210 20% 10%) (card).

Every token with its colour

Generated from design-tokens/dist/variables.css: the Light and Dark columns show the value and a swatch (:root and .dark).

Bg

TokenLightDark
--c-bg-base#fafafa#101418
--c-bg-surface#ffffff#14191f
--c-bg-subtle#f3f5f6#212931

Border

TokenLightDark
--c-border-default#dfe3e7#29333d
--c-border-light#ebedf0#1d242b
--c-border-focus#0961aa#0da2e7

Text

TokenLightDark
--c-text-default#29333d#f0f2f5
--c-text-secondary#47596b#b3bfcc
--c-text-muted#737f8c#8b99a7
--c-text-hint#949ea8#637383
--c-text-disabled#9da6af#586674
--c-text-onPrimary#ffffff#101418

Primary

TokenLightDark
--c-primary-default#0961aa#0da2e7
--c-primary-dark#085391#3ebaf4
--c-primary-darker#064579#6ecbf7
--c-primary-subtle#ecf6fe-
--c-primary-border#9ed1fa-
--c-primary-text#0961aa#56c3f5

Success

TokenLightDark
--c-success-default#28af60#2abb67
--c-success-dark#1a7440#44d580
--c-success-subtle#eafaf1-
--c-success-border#acecc7-
--c-success-text#1a7440#6ede9c

Warning

TokenLightDark
--c-warning-default#f59f0a#f6a823
--c-warning-dark#935f06#f8bc54
--c-warning-subtle#fef7eb-
--c-warning-border#facf85-
--c-warning-text#935f06#f9c56c

Danger

TokenLightDark
--c-danger-default#dc2828#bb2a2a
--c-danger-dark#9a1919#d54444
--c-danger-subtle#fceded-
--c-danger-border#f1a7a7-
--c-danger-text#9a1919#e38282

Info

TokenLightDark
--c-info-default#0b87c1#0da2e7
--c-info-subtle#e7f6fe-
--c-info-border#95d9f9-
--c-info-text#085f87#65c8f6

Accent

TokenLightDark
--c-accent-default#28af60#2abb67
--c-accent-subtle#eefbf4-
--c-accent-text#28af60#6ede9c

Focus

TokenLightDark
--c-focus-ring#6eb9f7#3ebaf4

Disabled

TokenLightDark
--c-disabled-bg#eef0f2#1d242b
--c-disabled-text#9da6af#586674
TokenLightDark
--c-sidebar-bg#1d3549#0f141a
--c-sidebar-foreground#e0e6eb#b6bfc8
--c-sidebar-primary#0da2e7#0da2e7
--c-sidebar-accent#284b67#1b242d
--c-sidebar-border#24435c#1b242d

Light and dark

  • Content theme (components/lib/theme.js): the preference light | dark | auto is stored in localStorage under content_theme_preference. applyTheme toggles the dark class on <html>; auto follows prefers-color-scheme. The .dark block of index.css then replaces the HSL values.
  • Sidebar theme (SidebarThemeContext.jsx): separate switch, stored as sidebar_theme (dark by default). The colours are in sidebarPalette.js (sidebarDarkPalette, sidebarLightPalette, getSidebarPalette(isDark)): rail, panel, border, hover, text levels, the active accent, the online dot, the danger text, the popover and its shadow.
  • The Settings page has the sidebar switch; the Preferences page offers light | dark | auto.

Hard-coded colours

Some screens still use literal hex colours (for example the status chips in Campaign.jsx, and table.css). They do not follow dark mode. Move them to tokens when you touch the screen.

Using colours in code

import { C, S, st } from "@playtelly/tellyboard-theme"     // the only source; never a local copy

<div style={{ background: C.surface, border: `1px solid ${C.border}`, color: C.text }}>...</div>
<button style={st.btnPrimary(false)}>Save</button>

// design-tokens helper: a CSS variable reference
import { cv } from "@playtelly/design-tokens"
<span style={{ color: cv("primary.default") }} />
  • Tailwind classes use the shadcn names: bg-background, text-foreground, bg-primary text-primary-foreground, border-border, text-muted-foreground, bg-destructive.
  • Fonts: Hanken Grotesk (text), IBM Plex Mono (ids, code), Inter for the shared helpers. tailwind.config.js maps font-sans and font-mono to them.

Changing the palette

  1. Change the HSL values in src/index.css (both :root and .dark): Tailwind and the --c-* aliases update.
  2. Mirror the change in the design tokens source and run npm run build:tokens in design-tokens if the hex tokens must match.
  3. Search for hard-coded hex values on the screens you touched.