# Primitives

ARK's design tokens for colour, size, typography, radius and elevation.

## Installation

The tokens ship in `@kela-systems/tokens`. An app that installs the components already has them:

```bash
pnpm add @kela-systems/ui-components
```

## Usage

One import, after Tailwind, brings the tokens, the utilities built on them and the fonts:

```css
@import "tailwindcss";
@import "@kela-systems/ui-components/styles.css";
```

Style your own elements with the semantic utilities, such as `surface-raised`, `text-neutral-secondary` and `border-neutral-primary`. Each one reads a CSS variable, so it follows the theme. Never write a raw colour.

## Theming

ARK has three themes. The theme is a class on `<html>`: none for light, `dark` for dark, and `dark dark-contrast` for dark contrast. The button at the top of this site switches between them, and every sample on these pages follows it.

## CSS variables

Every token is a CSS variable. Primitives are fixed values, such as `--dimension-4` and `--rounded-md`. Semantic tokens, such as `--fg-neutral-primary`, point at a different palette step in each theme. For code that can't read CSS variables, `@kela-systems/tokens/values.json` has every semantic token's resolved value per theme.

## The primitives

- [Color](https://ark.kela.design/product/primitives/color.md): Palettes and the semantic tokens built on them, in every theme.
- [Size](https://ark.kela.design/product/primitives/size.md): The dimension scale behind every gap, padding, width and height.
- [Typography](https://ark.kela.design/product/primitives/typography.md): Text styles, and the size, weight and spacing scales behind them.
- [Radius](https://ark.kela.design/product/primitives/radius.md): Corner radii, from a checkbox to a full pill.
- [Elevation](https://ark.kela.design/product/primitives/elevation.md): Shadows that lift a surface above the page, and the focus rings.
