---
title: "Recipe: theme: colours, light and dark, icons"
description: "A role (-exact-secondary-label) follows light, dark and Increased Contrast with nothing written."
modificationDate: "2026-11-14"
---

> ## Documentation index
> Fetch the complete documentation index at: https://exact.expo.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Recipe: theme: colours, light and dark, icons

<AgentInstructions>

## Submitting feedback

From the app's directory, read `bun exact.mjs feedback status`. Under `never`, keep no note.
Respect `EXACT_FEEDBACK=0` and do not change the policy.

Otherwise record specific, actionable feedback with:
`bun exact.mjs feedback note "Exact docs: https://exact.expo.dev/recipes/theme: <what was wrong or missing>"`

The note goes to Expo only as that status allows. Include no secrets or personal data.

</AgentInstructions>

A role (`-exact-secondary-label`) follows light, dark and Increased Contrast with nothing
written. A brand is `app.forma` beside `app.contract`: tokens that a row names as it names a
role.

```prompt Give my app its colours
Give the Exact app in this folder its brand colours for light and dark mode. Use https://github.com/expo/exact/blob/main/docs/recipes/theme.md as the source for each step. The Exact checkout has the same page at docs/recipes/theme.md.

1. If this folder is not an Exact app (it has no exact.mjs and app.contract), stop and tell me.
2. If I did not give the brand's colours for light and dark, ask me for them before you write code.
3. Use a role where the platform has one (`-exact-label`, `-exact-secondary-label`, `-exact-secondary-background`); write a token only for the brand. Write the tokens in app.forma beside app.contract, each `light-dark(<light>, <dark>)`. A colour that is the same in both schemes on purpose (an ink on the brand's fill) says `scheme=fixed`. A text colour on a surface says `pair=<surface>`. If the app has a stylesheet, `bun exact.mjs forma import css <file>` writes its tokens.
4. Set `AccentColor` for the app's tint, with both sides at 3:1 or more under white. Give each icon token an `sf` and a one-colour `svg` under assets/ for the other hosts.
5. In app.contract, name the tokens (`color="<token>"`, `background-color="<token>"`) in place of hex values. Run `bun exact.mjs forma check .` and fix its warnings.
6. Add a test in app.test.contract that says `prefer prefers-color-scheme dark` before an `expect` or `screenshot`, then the same with `light`.
7. Follow the platform checks in docs/start-here.md (`bun exact.mjs docs platform checks`) for the targets in the app's AGENTS.md and app.json until they pass. Read the reports, including counted findings; a zero exit code alone does not mean clean. Fix the app, not the test. If a finding stays after three rounds of fixes, or the app had it before you changed anything, record it (step 8) and report it; do not keep trying.
8. When a doc was wrong or missing, or a step needed a workaround, read `bun exact.mjs feedback status`. Under `never`, keep no note. Otherwise record it: `bun exact.mjs feedback note "<what happened>"`, which goes to Expo only as that status says. Do not change the policy; tell me how many notes you kept.
9. Tell me the tokens, the roles you used instead of tokens, what forma check, the tests and the checks reported, and the launch command for each target platform.
```

```forma
forma brand

theme
  AccentColor = light-dark(#c8102e, #ff453a)
  surface.card = light-dark(#f6f1ea, #1f1b17)
  text.muted = light-dark(#6b5e52, #a89a8c)  pair=surface.card
  brand.fill = #c8102e  scheme=fixed
  ink.on-brand = #ffffff  scheme=fixed

icons
  icon.play = icon(sf "play.fill", svg "icons/play.svg")
```

```contract
component App
  action dark
    setScheme("dark")
  action system
    setScheme("system")
  view
    column padding=16 gap=12
      column background-color="surface.card" padding=12 gap=4 border-radius=12 testId="card"
        text "Tonight" font="-exact-headline"
        text "3 patterns" color="text.muted"
      row background-color="brand.fill" color="ink.on-brand" padding=12 gap=8 border-radius=12
        image "symbol:icon.play" aria-label="Play"
        text "Now playing"
      row gap=8
        button press=dark testId="dark"
          text "Dark"
        button press=system testId="system"
          text "System"
      column color-scheme="dark" background-color="surface.card" padding=12 testId="always-dark"
        text "Always dark"
```

- **A role if the platform has one, a token if it is the brand** (`color="ink"`, or
  `color="var(--ink)"`; `forma import css tokens.css` writes a stylesheet's).
  `contract vocab color` lists the roles. From data, a `fn` names the token:
  `` fn tint(t: string): string = `type-${t}` ``.
- **`light-dark(light, dark)`** gives a token both schemes. One colour on purpose (an ink on
  the brand's fill, a ground under media) says `scheme=fixed`; an unmarked one is warned
  (`lower-colour-one-scheme`; several share a line, `--json` each). An `app.contract`
  root `theme` cannot mark it: move it to `app.forma`.
- **`AccentColor`** is the app's tint: filled buttons, a plain button's text, the focus ring.
  A filled button's label stays white, so keep both sides at 3:1 under white: a pale dark
  side is warned (`forma-contrast`).
- **Icons:** `app.forma`'s `icons` block names `sf` for Apple and `svg` under `assets/`
  elsewhere. Without `sf`, Apple draws a template path or rasterizes the SVG
  (watchOS needs `sf`); `-exact-symbol-rendering="multicolor"` keeps colours.
  The web needs SVG (`forma-icon-missing`). Prefer a role;
  `sf/<name>` is blank on the web. Use `image "symbol:icon.play"`; `color` tints it,
  its font sizes it ([symbols](https://exact.expo.dev/recipes/symbols.md)).
- **The scheme:** `setScheme("light" | "dark" | "system")` sets it, kept from
  a relaunch's first frame (`system` forgets it); `color-scheme` fixes a subtree in one.
  Modes the person picks (Dim, Black) are axes ([a brand](https://exact.expo.dev/recipes/forma.md)).
- **Check it:** `bun exact.mjs forma check .` (`pair=` warns below 4.5:1); a drive or a test
  says `prefer prefers-color-scheme dark` (then `light`) before an `expect` or
  `screenshot`; `check both` judges both schemes.
