# Presentation & Theming

Presentation — colors, spacing, fonts, chart dimensions — is a **render-time parameter** in ChainRender. You can
change how an app looks without redeploying it, at zero gas. This page explains how, and why it's separated from
the app's immutable identity.

## The principle: skin is free, substance is baked

*How an app looks* doesn't change what it *is* or *does*. So presentation is not part of the app's hash — it's
supplied when the app renders, via a **presentation context**:

```ts
renderHashWithContext(hash, {
  themeId,          // which on-chain theme (colors/fonts/spacing) to apply
  palette,          // chart/image palette override
  chartW, chartH,   // chart dimensions
})
```

Change any of these and the *same app* (same hash) renders differently. No new deployment, no new identity, no gas
beyond the read. A developer can iterate on the whole page's look — spacing, font size, colors — instantly and for
free, and only commit a chosen theme on-chain once, when it's dialed in.

## Why this division exists

Forcing a redeploy for a cosmetic tweak would be wasteful (gas per nudge) and meaningless (a color change doesn't
alter what the app does). Worse, it would pressure developers to ship "good enough" rather than iterate to "right,"
because every iteration would cost. Making presentation render-time removes that friction entirely — which is
exactly why the system draws the line here: **appearance is presentation (free, render-time); text, structure, and
actions are identity (immutable, in the hash).**

## The token system

Themes are built from **design tokens** — a W3C-aligned set of semantic values (colors, typography, spacing,
sizing, borders, elevation, motion). Components reference tokens (`--cr-space-md`), not hardcoded values, so a theme
change re-flows the whole page. Tokens are drift-locked between the on-chain generator and the SDK, and a
**contrast invariant** ensures every theme meets WCAG AA — a low-contrast theme can't ship.

Three presets ship: **light**, **dark**, and **high-contrast** (WCAG AAA).

**Layout and type tokens (Enhanced mode).** Client 0.20's Enhanced mode adds a style registry (21 token
families: layout, gap, pad, surface, tone, size, badge, marker, …) whose structure CSS uses only these theme variables,
each with the light theme's value as its fallback, and never sizes text below the 12 px floor. It is VERSION_5 output: the
interpreter is on Sepolia, Robinhood and Arc (OpcodeInterpreterV5Html, 2026-11-02), and the viewer and the builder's
preview carry the structure CSS (docs/202 phase 3). The builder offers Enhanced only on a chain whose RenderRouter has the
V5 interpreter. Classic (the default) is unchanged. See
**[Style Tokens](../reference/style-tokens.md)** and docs/202.

## Related
- **[Guides → Theme Without Redeploying](../guides/theme-without-redeploy.md)** — hands-on.
- **[Content Addressing](./content-addressing.md)** — why substance is baked.
