# Theme

URL: /business/nouns/theme · Id: `noun:theme`

> A Theme is the design tokens of a Brand, its color, type, spacing, radius, and motion, that every Component reads when it renders.

A Theme is the design tokens of a [Brand](/business/nouns/brand), its color, type, spacing, radius, and motion, that every [Component](/business/nouns/component) reads when it renders.

## Properties
| Property | Type | Required | Description |
| --- | --- | --- | --- |
| `tokens` | `json` | Yes | The token values, in light and dark modes. |
| `css` | `text` | No | Extra CSS, applied after the tokens. |

## Object
```json
{
  "$id": "https://api.sb/ledgerlark.com/themes/theme_1",
  "$type": "Theme",
  "tokens": {},
  "css": ":root { --radius: 6px; }"
}
```

## Relationships
- <a id="rel-themes"></a>A Theme **themes** many [Brands](/business/nouns/brand): a Theme sets a [Brand](/business/nouns/brand)’s color, type, spacing and motion. `themes`, inverse [`themedBy`](/business/nouns/brand#rel-themed-by).

## Verbs
| Verb | Description | Subject | Event | Class |
| --- | --- | --- | --- | --- |
| <a id="create"></a>[Theme.create](/business/nouns/theme/create) | Creates a Theme. Inherited from [Noun](/business/nouns/noun). | None. | `Theme.created` | Two-way: `try`, `send`, `do` |
| <a id="get"></a>[Theme.get](/business/nouns/theme/get) | Returns one Theme by id. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="list"></a>[Theme.list](/business/nouns/theme/list) | Returns Themes, newest first, one page at a time. Inherited from [Noun](/business/nouns/noun). | None. | None. | Read: `try`, `do` |
| <a id="update"></a>[Theme.update](/business/nouns/theme/update) | Changes the given properties of a Theme. Inherited from [Noun](/business/nouns/noun). | None. | `Theme.updated` | Two-way: `try`, `send`, `do` |
| <a id="delete"></a>[Theme.delete](/business/nouns/theme/delete) | Deletes a Theme; its history is kept. Inherited from [Noun](/business/nouns/noun). | None. | `Theme.deleted` | One-way: `send`, `do` |

## Permissions
Which Access level may call each Verb. One-way Verbs wait their delay window.

| Operation | `owner` | `admin` | `member` | `viewer` |
| --- | --- | --- | --- | --- |
| `Theme.create` | Yes | Yes | Yes | No |
| `Theme.get` | Yes | Yes | Yes | Yes |
| `Theme.list` | Yes | Yes | Yes | Yes |
| `Theme.update` | Yes | Yes | Yes | No |
| `Theme.delete` | Yes | Yes | Yes | No |

## Call it

**Ask**

```text
Add a theme to PatentPad.
```

**API**

```bash
curl -X POST https://api.sb/patentpad.com/themes \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tokens":{}}'
```

```json
{
  "api": "https://api.sb/patentpad.com",
  "theme": {
    "$id": "https://api.sb/patentpad.com/themes/theme_1",
    "$type": "Theme",
    "tokens": {}
  },
  "action": {
    "$id": "https://api.sb/patentpad.com/actions/action_1",
    "operation": "Theme.create",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/patentpad.com/actions/action_1"
  }
}
```

**SDK**

```ts
import { $ } from 'startup-builder'

const theme = await $.Theme.create({ tokens: {} })
```

**CLI**

```bash
npx startup-builder do Theme.create --json '{"tokens":{}}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Theme.create({ tokens: {} })"
  }
}
```

## Example
```json
{
  "color": {
    "light": { "accent": "oklch(52% 0.08 200)", "ink": "oklch(24% 0.02 220)", "paper": "oklch(98% 0.004 200)" },
    "dark": { "accent": "oklch(70% 0.08 200)", "ink": "oklch(93% 0.01 200)", "paper": "oklch(19% 0.02 220)" }
  },
  "font": { "display": "Newsreader", "body": "Public Sans" },
  "radius": { "card": "6px" },
  "motion": { "duration": "200ms", "easing": "ease-out", "reduce": "0ms" }
}
```