Tamber design tokens
What Tamber is, the app's app.tamber file line by line, how Contract names a token, and how the design is checked.

Tamber is Exact's design system: a small .tamber grammar, a checker and one evaluator that folds a design into values every host reads (tamber/src/lib.rs). An app writes its own colours and type styles in app.tamber beside app.contract. Seed Exact keeps this file to the brand only: everything else is a platform role such as -exact-label or -exact-secondary-background.

The file

app.tamber is 15 lines:

tamber seed theme AccentColor = light-dark(#007a70, #26a596) brand = light-dark(#007a70, #26a596) brand.fill = light-dark(#007a70, #147a71) pair=ink.on-brand brand.subtle = light-dark(#e3f4f2, #0f2e2b) danger.fill = light-dark(#b42318, #c4281c) pair=ink.on-brand ink.on-brand = #ffffff scheme=fixed type.reading = -exact-body/1.4 type.code = -exact-footnote/1.4 ui-monospace, Menlo, monospace

Line

Meaning

tamber seed

Names the design

theme

The block of tokens. Names may be dotted

AccentColor

The app's tint on Apple hosts: the keyboard focus ring, selection and system controls follow it

brand

Seed teal for links, symbols, a plain button's title, the tab bar's selection and a filled button's fill. The comment in the file records the contrast targets: light at least 4.5:1 under white, dark at least 3:1 under white

brand.fill

A surface under body-size white text (my chat bubbles, badges). At least 4.5:1 under white in both schemes

brand.subtle

Selected rows and the embed card edge (DESIGN.md)

danger.fill

A failed badge under white text

ink.on-brand

White text on brand fills

type.reading

Document paragraphs: the platform body style with 1.4 line height, so it follows Dynamic Type

type.code

Code blocks: the footnote style, 1.4 line height, a monospace stack

The value syntax

    light-dark(a, b) is CSS's function: the first colour in the light scheme, the second in dark. The app follows the system scheme and declares no modes of its own (no axes block).

    pair=<token or role> after a foreground or fill names what it is drawn with. tamber check warns when the pair falls below 4.5:1 (tamber-contrast).

    scheme=fixed marks a token that is one colour in every scheme on purpose. Without it, a one-colour token is reported once (lower-colour-one-scheme).

    A type token is CSS font syntax, size/line-height family. font="type.reading" writes only the longhands the token names, so the text style's own weight still applies. A size in px would be warned of (tamber-type-fixed) because it does not follow the reader's text size.

These rules are in Exact's guide for agents and the tamber recipe.

How Contract names a token

A row names a token exactly as it names a platform role, as a string value:

Use

Example

Source

App tint

accent-color="brand" on the root main

app.contract L744

Colour

color="ink.on-brand", background-color="brand"

ui.contract L19, read.contract L246

Type

font="type.reading"

read.contract L192

Atom colour

atom agentDocument link="hm:" color="brand"

agents.contract L5

var(--brand) is an equivalent spelling. The app's rule, from DESIGN.md, is "No colour literals in screens". One documented exception is the avatar disc, whose hsl(…) colour is computed from the name (ui.contract L4-L15).

Checking the design

Command

What it does

bun exact.mjs tamber check .

Prints each refusal or warning at its line

bun exact.mjs tamber eval .

Prints name = value for each token

bun exact.mjs tamber fmt . --check

Verifies the file's one layout

contract build and verify run the design through the same evaluator, and verify's check step reports low contrast on real screens, see Verify and visual checks. During development the web dev loop serves the design at /__tamber for live edits (protocol). The app does not use that in its workflow (inferred: nothing in the app references it).

Do you like what you are reading? Subscribe to receive updates.

Unsubscribe anytime

Comments