breakstuff
Design System
Theme:
The tokens, primitives, and rules that build every surface. Switch themes to preview.
Semantic Colors
Spacing
--1 4px --2 8px --3 12px --4 16px --5 20px --6 24px --8 32px --10 40px --12 48px --16 64px --20 80px Radius
base-radius-none 0px base-radius-sm 4px base-radius-md 6px base-radius-lg 8px base-radius-xl 12px base-radius-full 9999px Typography
base-size-xs
The quick brown fox
11px base-size-sm
The quick brown fox
13px base-size-md
The quick brown fox
15px base-size-lg
The quick brown fox
18px base-size-xl
The quick brown fox
22px base-size-2xl
The quick brown fox
28px base-size-3xl
The quick brown fox
36px base-size-4xl
The quick brown fox
48px base-size-5xl
The quick brown fox
64px Motion
base-dur-fast · base-ease-out base-dur-fast · base-ease-inOut base-dur-base · base-ease-out base-dur-base · base-ease-inOut base-dur-slow · base-ease-out base-dur-slow · base-ease-inOut Rules for consumers
@breakstuff/tokens
# @breakstuff/tokens — consumer rule
You are editing code that depends on `@breakstuff/tokens`. Follow these rules.
## Setup
Import the stylesheet **exactly once** at the app root:
```ts
import '@breakstuff/tokens/tokens.css';
```
Apply the `.ds-app` class to the top-level container (usually the `<body>` or its first child) so the reset and base typography apply.
## Tokens you may use
Only **semantic** tokens. Every one is a CSS custom property starting with one of:
- `--bg`, `--surface`, `--surface-raised`
- `--on-bg`, `--on-bg-muted`, `--on-bg-subtle`
- `--on-surface`, `--on-surface-muted`, `--on-surface-subtle`
- `--accent`, `--accent-hover`, `--accent-press`, `--accent-muted`, `--on-accent`
- `--border`, `--border-strong`, `--focus-ring`
- `--success`, `--success-muted`, `--on-success` (same shape for `warning`, `error`, `info`)
- `--chart-1`..`--chart-5`
- `--sp-1`..`--sp-20`, `--page-padding`, `--section-gap`, `--component-gap`, `--item-gap`, `--inset-sm`, `--inset-md`, `--inset-lg`
- `--radius-badge`, `--radius-input`, `--radius-card`, `--radius-modal`, `--radius-pill`
- `--font`, `--text-micro`..`--text-giant`, `--weight-*`, `--leading-*`, `--tracking-*`
- `--ease`, `--ease-io`, `--dur-fast`, `--dur-base`, `--dur-slow`
## Tokens you must NOT use
- Anything starting with `--base-*`. These are the raw palette layer. Referencing them bypasses theming and will break when themes change.
## Themes
- Default theme is `dark-orange`. No attribute needed.
- Switch themes by setting `data-theme="dadbod"` on `<html>` (or any ancestor of the subtree you want themed).
- Adding a theme is a change to `@breakstuff/tokens`, not a consumer concern.
## Focus
- Rely on `:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }`. The `.ds-app` class sets this globally. Do not override it.
## Hard-coded colors
- Do not use hex / rgb / hsl values in application CSS. If you need a value that has no semantic token, stop and add a token to `@breakstuff/tokens` first.
@breakstuff/primitives-react
# @breakstuff/primitives-react — consumer rule
You are editing code that depends on `@breakstuff/primitives-react`. Follow these rules.
## Setup (one-time, at the app root)
```ts
import '@breakstuff/tokens/tokens.css';
import '@breakstuff/primitives-react/styles.css';
```
Both imports must happen exactly once each, and **tokens.css must come first**.
## Primitives available
- `Button` (single component). Props: `variant: "primary" | "secondary" | "ghost"`, `size: "sm" | "md" | "lg"`, `tone: "accent" | "neutral" | "danger"`, `asChild`, plus native `<button>` attributes.
- `Dialog` (compound): `Dialog.Root`, `Dialog.Trigger`, `Dialog.Content` (requires `title: string`, optional `description`), `Dialog.Footer`, `Dialog.Close`.
- `Tabs` (compound): `Tabs.Root`, `Tabs.List`, `Tabs.Trigger`, `Tabs.Panel`.
Always use the primitive from this package in preference to raw `@radix-ui/*` or hand-rolled HTML controls. If something is missing, **add it to this package** — do not one-off it in an app.
## Composition
- Use the **compound API** (`Dialog.Trigger`, `Tabs.Panel`). Never import sub-pieces by name from `@radix-ui/*` directly.
- `asChild` is the only supported way to change the rendered element:
```tsx
<Button asChild>
<a href="/go">Go</a>
</Button>
```
Never add an `as` prop.
- Disabled state uses the native `disabled` attribute. Never set `aria-disabled` manually.
## className
`className` is a **layout escape hatch only** — use it for margin, grid placement, or positional tweaks. Never use it to:
- Re-skin colors, backgrounds, borders, or text styles of the primitive.
- Change padding or font-size of the primitive.
If you need to restyle a primitive visually, add a new variant / tone / size to the primitive in this package.
## Focus
Focus styling is handled by the `.ds-app` class from `@breakstuff/tokens`. Do not add component-level focus styles.
Primitives
Button
Dialog
Tabs
Today's lift.