Skip to content
oxidaseSign in

Oxidase design system

The tokens, components and patterns behind every Oxidase screen, rendered by the code that ships.

Components

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.

PropValuesDefaultWhere
variantprimary, secondary, dangersecondaryButton, ButtonLink, IconButton. An IconButton without one is a bare glyph.
sizesmall, regular, largeregularButtons and icon buttons: 32, 44 and 48 pixels. SegmentedControl takes small or regular.
toneneutral, indicator, warning, danger, earnedneutralStatusBadge (earned is XP), Notice and Timeline without earned.
paddingnone, compact, regularregularSurface and SurfaceLink. Regular is the one card padding.
componenta link element, such as next/linkaButtonLink, TextLink, SurfaceLink, ListRow, NavTabs, DataTable.
xstylelayout onlynoneEvery 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 xstyle to 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 setting color-scheme by hand. Ground declares every color token again with fixed values.
  • Set type with textStyles or <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> carries pageMarker and rootStyles.html, and <body> carries rootStyles.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.css is imported once. It holds a small reset in its own layer and the @stylex directive, which the build replaces with the compiled styles in later layers.
  • Mona Sans loads through next/font in app/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/ui it uses only the StyleX-free subpaths: surface-context, use-surface-context and contrast.