Themes

Pick a theme on this site, watch both kits change live, then commit it to your project with one code.

Every page of this site has a theme bar at the bottom. Until you pick anything, the site's colour drifts through a few hues. Pick a preset or a brand colour and the whole site changes, along with every live phone and browser frame in it: those are the real kits, re-themed as you pick. Drifting colours, first in both of the bar's menus, sets it moving again. Studio keeps your picks as systems, saved in this browser: several side by side (a portfolio and a client, say), each with its own theme, logo and name, with undo and a shuffle that rolls new values for the theme. The bar follows whichever system is active.

Nothing you pick here touches a project until you use the system: the bar and Studio hand you a short code (ht1-…, or ht2-… once you change the typeset) that reproduces the theme exactly, and one command writes it into tokens/tokens.json.

What a theme sets

Options
Brand colourAny colour. The swatches are Tailwind's ramps; any other colour generates an 11-step ramp in OKLCH around it.
NeutralZinc, neutral, slate, stone, gray, or a grey tinted with the brand hue
RadiusNone to 2xl, and whether buttons and chips are pills or follow the radius (in both kits)
TypeA heading, a body and a mono font from a curated list of Google Fonts
TypesetBody text size (14–18px; every text size scales with it), leading (line height), and for long-form text, flow (space between paragraphs) and measure (the longest line)
IconsLucide's stroke: thin, regular or bold
DepthFlat, soft, raised or hard (offset) shadows on cards, sheets and menus
DensityCompact, comfortable or spacious: button and input heights and padding in both kits, the native kit's other controls, and the whole spacing scale on the web
BorderHairline, regular or heavy outlines
ButtonsThe primary button: solid, soft (a brand tint with brand text), outline, or raised (a darker bottom edge)
InputsText fields, text areas and selects: outlined boxes, filled (a tinted field with a line), or underline (just a line)

Status colours (success, warning, destructive, info) stay as they are.

Contrast is never your problem

A brand colour can look right and still fail as text: amber links, yellow buttons, a blue that's fine on white and too dark on the dark theme. The generator checks every pairing the kits render, in both themes (the same gate as tokens:build, plus tones on muted surfaces), and moves anything that fails: same hue, the smallest lightness change that passes WCAG AA. The studio's Contrast row shows how many colours it adjusted; open it to see each one, before and after. A theme from the picker always passes, even in strict mode.

Use a theme

Use system gives you these ways to take it with you:

  • Ask your coding agent. Copy the prompt; the kits' apply-theme skill applies the code, runs the checks and tells you what it adjusted.

  • In the Halftone repo, from the root, so the native kit, the web kit and this site stay one brand:

    npm run theme:apply -- ht1-XXXXXXXXXXXX
  • In a kit you copied out, from the app folder:

    npx halftone-tokens theme apply ht1-XXXXXXXXXXXX
  • Share a link (/studio/?t=<code>) to show someone the theme, or download tokens.json and drop it in. A shared link opens read-only in Studio, with Save as new system; it never replaces your own.

  • Download the .halftone.json (Use system, or Export in Studio's system menu) and apply the file the same way: npx halftone-tokens theme apply ./my-system.halftone.json.

apply only rewrites what a theme owns: the brand and neutral ramps, the semantic colours, radius, fonts, shadows, borders, icon stroke, control sizes, the typeset and motion (durations, easings and springs, at the theme's Speed). Spacing, the base type scale and your descriptions stay. It records the theme in tokens.json, so halftone-tokens theme show (and each kit's Foundations page) can say which theme is applied, and whether anyone has edited its tokens by hand since. apply won't overwrite hand edits without --force.

npx halftone-tokens theme presets     # the presets and their codes
npx halftone-tokens theme show        # the applied theme
npx halftone-tokens theme apply calm --dry-run

Brand assets

A theme code carries no logo, so each system keeps its own: add it under Brand at the top of Studio (an SVG is best; a PNG works). A one-colour SVG is recoloured to follow the theme's text colour, light and dark; a coloured logo or a PNG can have a dark version. Add a square mark for the app icon, or the logo is fitted into the square. Foundations shows the logo on light and dark, the app icon as iOS and Android draw it, the splash screens and the favicon, and the live kits show it in their headers.

Use system › Brand assets downloads it as a zip laid out like the kit, every image drawn in your browser at the sizes each platform needs:

ZipUnzip atContains
brand-mobile.zipthe native kitlib/brand.ts for <Logo>, the app icon, Android's adaptive icon, light and dark splash screens, the web favicon, and assets/brand/brand.json (icon background, splash colours)
brand-web.zipthe web kitlib/brand.ts, app/icon.png and app/apple-icon.png
brand.zipthe Halftone repoboth, under apps/mobile and apps/web

Copy the prompt beside the buttons for your coding agent: the kits' apply-theme skill unzips it, checks it and shows you the logo in both themes. The logo stays in this browser until you remove it; nothing is uploaded.

Codes

A code is the whole recipe, packed into twelve characters with a checksum, so a typo is caught rather than quietly giving you a different theme. A theme that changes the typeset is an ht2- code (16 characters); one with button or input styles is ht3- (18 characters, and @halftone-ds/tokens 1.2 or later). A theme keeps the shortest code that holds it, so codes made before a format existed never change. The same code produces the same theme in every version of @halftone-ds/tokens that reads it; a generator change that would alter a theme comes with a new code version.

From and to shadcn

Halftone reads shadcn/ui preset codes, and writes its themes as shadcn theme items, so a theme travels both ways.

A shadcn code in. Paste one (like b5owWMfJ8l) into the studio's Open box, or apply it from a kit:

npx halftone-tokens theme decode b5owWMfJ8l   # what it holds, and the Halftone theme it becomes
npx halftone-tokens theme apply b5owWMfJ8l --dry-run

It becomes the nearest Halftone theme, and every value that doesn't carry over exactly is listed:

shadcnHalftone
Base colour neutral, stone, zinc, graythe same neutral
Base colour mauve, olive, mist, taupethe nearest grey (zinc, stone, slate, stone)
A coloured theme (blue, rose, …)that colour's 600 as the brand
A grey themea monochrome brand, that grey's 900
Radius small, largeHalftone's nearest steps, sm and xl
A font Halftone doesn't listthe nearest of the same kind (Oxanium → Space Grotesk)
Icon library, chart colour, menu options, stylenot carried: Halftone's kits use Lucide, charts follow the brand, and density, depth and border come from Halftone

Contrast is fixed on the way in, as for any theme.

A Halftone theme out. Use system has a block for any shadcn project. A preset installs from this site:

npx shadcn@latest add https://halftonedesignsystem.com/r/theme/editorial.json

Any other theme downloads as halftone-theme.json; put it in the project and run npx shadcn@latest add ./halftone-theme.json. Or from a kit: npx halftone-tokens theme shadcn <code> --out halftone-theme.json. It sets the colours for light and dark, the radius, the shadows and the fonts. It's a web theme: density, border, icon stroke and the typeset stay Halftone's, and phone apps take the theme code.

halftone-tokens theme resolve prints the code for a kit's tokens as they are, for scripts.

Bring your own tokens

A brand that already has a tokens.json (the W3C DTCG format, from a brand folder, Tokens Studio or another design-system tool) comes in as a system:

npx halftone-tokens import ./tokens.json --name "Acme"   # writes acme.halftone.json
npx halftone-tokens theme apply ./acme.halftone.json      # from a kit, as for any system

The import reads the brand's own names, whatever they are, and says what it guessed, one line each:

The brand's file hasIt becomes
Sets of role colours (light, dark, or named ones like sand and char)The lightest page is light, the darkest dark. A third set becomes extra colours. No dark set: dark is generated
background, card, foreground, border and their usual other names (background-secondary, stroke, ink)The same roles, with the brand's colours exactly
primary, else brand or accentPrimary, and the seed of the brand ramp
A numbered family (green.50 … green.900) holding a role's colourThat ramp, with the family's steps
Colours no role takesExtra colours, exported for your own use
FontsSet when the family is on Google Fonts. A brand's own font file stays out until it can be uploaded
Corners and shadowsHalftone's steps, by name or by size
Everything else (spacing, a line weight, a grid)Kept inside the system under tokens, not drawn by the kits

Contrast works differently from a theme: the brand chose its colours, so they're kept as they are, and any pairing below WCAG AA is listed instead of changed. Fix one in the Studio if you want AA there.

On this page