# System

A parametric design system for a robotic foundation model platform. A few parameters make every colour, a few primitives make every component, and one package, `@qualia-studios/design-ui`, carries them to every surface we ship.

## Principles

1. **Parametric over hardcoded**: Every token derives from a small set of parameters. The system is the source of truth; surfaces sample from it.
2. **Composition over configuration**: The library is small primitives that combine. Variants emerge from composition. Complexity lives at the edges, not in the core.
3. **Restraint over decoration**: Tone, weight, and rhythm do the work. The brand reads as engineering: careful, measured, exact.

## Layers

The system is a stack, read from the bottom: each layer is computed from the one beneath it, so a change at the base reaches every component without an edit above it.

1. **Parameters** A hue, a chroma, a contrast and the theme. Change one and everything above follows. `palette/params.js`
2. **Palette** Eight tones by eleven shades in OKLCH, baked to colours that keep their contrast in both themes. `styles/colors.css`
3. **Primitives** The faces, the UI and prose scales of type, space and radius, and the measures. `styles/primitives.css`
4. **Roles** What a value is for: a surface, an ink, the accent, a heading, a syntax token. Code reads roles, never shades. `styles/tokens.css`
5. **Components** Svelte primitives built only from roles: buttons, inputs, layers, status, structure. `components/`

## Where it ships

One package, four readers. Each takes the layers it needs and adds only its own register; none copies a value.

| Surface | What it reads |
| --- | --- |
| Dashboard | Roles and components, the UI scale, the syntax roles in its editors |
| Docs | Roles in its own shell, the syntax theme in its code blocks |
| qualia.dev | Faces, palette, the prose scale and the mark; its own glass register on top |
| This guide | Everything, and serves it to agents as markdown, JSON and CSS |

## Examples

### Example 1: One parameter, every role

The accent's fill, ink and border are all read off one hue; change it on the Colors page and these move together.

```svelte
<div style="display: flex; align-items: center; gap: var(--q-space-md);">
  <span
    style="padding: var(--q-space-2xs) var(--q-space-sm); border-radius: var(--q-radius-control); background: var(--q-accent-fill); color: var(--q-on-accent-fill);"
    >Fill</span
  >
  <span
    style="color: var(--q-accent-text); font-weight: var(--q-weight-semibold);"
    >Ink</span
  >
  <span
    style="padding: var(--q-space-2xs) var(--q-space-sm); border: 2px solid var(--q-accent-border); border-radius: var(--q-radius-control);"
    >Border</span
  >
</div>
```

The parameters themselves live on [Colors](https://q-core-3b2732.gitlab.io/tokens/colors.md).

---

From the Qualia design guide: https://q-core-3b2732.gitlab.io/system. Every page as markdown: https://q-core-3b2732.gitlab.io/llms.txt
