> ## Documentation Index
> Fetch the complete documentation index at: https://collabase.ch/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Collabase documentation. Interface labels are quoted in English, as they appear in the product.
> Features marked Enterprise need the Collabase Enterprise Edition licence.

# Collakit token package

> How the tokens, presets and role names of Collabase are generated into the packages/collakit package, and the contract that keeps the names stable.

The package `packages/collakit` carries the design tokens of the core for apps. It is generated, so an app that reads it looks like Collabase. For the product behind it, see [Collakit](https://collabase.ch/docs/developer/collakit.md).

| File | Content |
| - | - |
| `tokens.css` | Light and dark token values and every accent preset |
| `tokens.json` | The same data for tools |
| `CONTRACT.md` | The list of role, preset and token names |

## Generate it

The generator reads `src/app/tokens.css`, `src/app/themes.css` and the role names from `src/app/roles.css`.

```bash title="Write the package" theme={"dark"}
npm run generate:collakit-tokens
```

```bash title="Check that the package is current" theme={"dark"}
node scripts/generate-collakit-tokens.mjs --check
```

The check fails when a file differs from what the generator would write. It is part of `npm run check`, so a token change without a regenerated package does not pass.

The generator stops when the core stylesheet lacks a required token, such as `--surface-page`, `--ink`, `--accent-brand` or `--control-height`, or when a preset has no dark block.

## The contract

A name in `CONTRACT.md` is a promise. It keeps its meaning until a major release of Collakit. Do not edit the file by hand.

* Apply a preset as `theme-{name}` on the body.
* Add a token or role to the core first, then regenerate. The package never defines names of its own.
* The package imports nothing from the app.

## Related

* [Design tokens and roles](https://collabase.ch/docs/developer/ui/tokens-and-roles.md)
* [Collakit](https://collabase.ch/docs/developer/collakit.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.