Oxidase design system
The tokens, components and patterns behind every Oxidase screen, rendered by the code that ships.
Components
- Buttons
- Icon buttons
- Text link
- Fields
- Checkboxes and radios
- SwitchReduce motion
- Segmented control
- Tabs
- Scored+5 XPWaitingStatus badges
- Notices
Display changed during this trial
- Card
Spatial hold
Six trials, about four minutes
- Rows
- SecurityPassword and devices
- AppearanceSystem theme
- Metric
Latest session
41/52cells held
- Legend and ladder
- Observed
- In progress
- Earned
- Evidence wells
Identity
Made, earned, exact: a tool built with care, a record that fills in as you work, data drawn precisely.
Paper and night
A warm paper canvas by day and near-black at night. Cards are white or a step above black, with a hairline edge.
Ink is the action
The one filled action is ink: a near-black pill by day, near-white at night. The second action is tonal ink.
Blue is data
True blue marks observations, selection and focus. It never decorates.
Yellow is earned
XP, milestones and standards met, with a darker rim so the fill holds its edge on paper.
One family
Mona Sans at one width and three weights. Size, weight, tracking and space carry the hierarchy; figures are proportional with a plain zero.
One radius scale
2 for thin marks, 3 for cells, 10 for fields and menus, 18 for cards and dialogs, and the pill.
Principles
One system
One button pair, one card, one radius scale, one link look. No second variant for one page.
At most two boxes deep
Canvas, then a card. Inside a card, group with space or a hairline rule, never another card.
Equal edges
Inner corners and padding agree with their container: sections run edge to edge or sit on its padding.
No eyebrows
No small label above a heading. A heading alone, with a subheading only when it says what the heading cannot.
Remove what can go
No captions on visuals, no restated headings, no text the information does not need.
Two hues
The only hues are data blue and earned yellow, with danger and warning for status.
Measured contrast
4.5:1 for text and 3:1 for field edges, focus and data marks, asserted in the token tests.
One view per page
Summary first, depth behind a disclosure or a drill-in page, the same for every member.
Shared vocabulary
The same prop means the same thing on every component.
| Prop | Values | Default | Where |
|---|---|---|---|
variant | primary, secondary, danger | secondary | Button, ButtonLink, IconButton. An IconButton without one is a bare glyph. |
size | small, regular, large | regular | Buttons and icon buttons: 32, 44 and 48 pixels. SegmentedControl takes small or regular. |
tone | neutral, indicator, warning, danger, earned | neutral | StatusBadge (earned is XP), Notice and Timeline without earned. |
padding | none, compact, regular | regular | Surface and SurfaceLink. Regular is the one card padding. |
component | a link element, such as next/link | a | ButtonLink, TextLink, SurfaceLink, ListRow, NavTabs, DataTable. |
xstyle | layout only | none | Every primitive: margins, placement and size. Color, type and inner spacing stay with the component. |
Using the system
Components come from @oxidase/ui and tokens from @oxidase/ui/tokens.stylex. Styles are StyleX, compiled at build time into atomic classes in one layered stylesheet. Every example on these pages renders the production component; the data in them is made up, and nothing here reads member records.
import * as stylex from "@stylexjs/stylex";
import { ButtonLink, Surface, Text } from "@oxidase/ui";
import { space } from "@oxidase/ui/tokens.stylex";
import Link from "next/link";
export function NextSession() {
return (
<Surface>
<div {...stylex.props(styles.body)}>
<Text as="h2" variant="title">Spatial hold</Text>
<Text variant="small" tone="secondary">Six trials, about four minutes</Text>
<ButtonLink href="/exercises/spatial-hold" component={Link} variant="primary">
Begin session
</ButtonLink>
</div>
</Surface>
);
}
const styles = stylex.create({
body: { display: "grid", gap: space.s12, justifyItems: "start" },
});- Import token files by their package export or a relative path, never through the
@/alias. The compiler resolves themes by module path. - Pass
xstyleto change where a component sits and how much room it takes. Color, type and inner spacing belong to the component. - Re-ground a region with
<Ground tone="dark">instead of settingcolor-schemeby hand. Ground declares every color token again with fixed values. - Set type with
textStylesor<Text variant>. Nothing goes below 13 pixels, and every interactive glyph has a name.
Setting up a page
The root layout prepares every page. Anything that replaces it, such as the global error page, does the same.
<html>carriespageMarkerandrootStyles.html, and<body>carriesrootStyles.body, so styles can respond to the theme and motion attributes on the root.- An inline script writes the stored appearance and motion settings before the first paint, so a page never flashes the wrong theme or animates against the setting.
app/globals.cssis imported once. It holds a small reset in its own layer and the@stylexdirective, which the build replaces with the compiled styles in later layers.- Mona Sans loads through
next/fontinapp/fonts.ts, from unmodified files kept with their licence. Missing Greek and math glyphs use the system fonts. Code samples use system monospace.
Things that break quietly
- A stylesheet outside the layers outranks every component style, so it can fork a primitive without anyone noticing. There is one global stylesheet; everything else is StyleX.
- The reset adds no interaction. A control built outside the shared components declares its own feedback, entrance and disabled cursor; nothing global supplies them.
- Nothing lifts or presses inside a task area. A transform changes a measured box, and Spatial hold records its grid geometry, so a control there must stay still.
- Code that plain Bun runs, such as mail and workers, must not reach a StyleX module. From
@oxidase/uiit uses only the StyleX-free subpaths:surface-context,use-surface-contextandcontrast.