Skip to content

D35 · Tailwind CSS for layout in apps/web, the design system unchanged

Accepted · 2026-10-13 · zuki · Partly superseded by D88 (Tailwind's reset is on; components come from the design system as shadcn components)

Decision: apps/web uses Tailwind CSS v4 for layout, spacing and one-off styling in pages and the shell. The Opleet design system stays as D8 says: tokens.css, opleet.css and components/opleet are unchanged, and a component's look comes only from its op-* classes and props, never from utilities laid over it.

Why: Page and shell layout is many small spacing and alignment choices that op-* classes don't cover. Writing them as inline styles or a stylesheet per page is slower to write and harder to review than utility classes. The scaffold was made with --no-tailwind (TL-M0-08) because the design system is plain CSS. That was a default of the first run, not a decision; nothing in the decisions ruled Tailwind out.

Consequences:

  • Tailwind lives in apps/web only, configured in CSS (no tailwind.config file), as the packages tailwindcss and @tailwindcss/postcss. apps/docs keeps Starlight's own styles.
  • Utilities sit in their own cascade layer, and opleet.css stays imported as it is, outside any layer. So a utility never overrides an op-* class, and the design system's files stay byte for byte what the design system published (D8).
  • No Tailwind reset and no default theme. opleet.css has its own base styles, and tokens.css already defines the font and colour variables. Tailwind's own theme would add a second --font-sans and a default palette beside the tokens.
  • Values come from the tokens, and the theme is generated. pnpm --filter web tokens also writes design/opleet/theme.css from tokens.json: an @theme inline block that maps each token to Tailwind's names (--color-green-500: var(--green-500), and so on), so utilities read the variables as the page runs and dark mode follows data-theme with no dark: variants. tokens --check fails when it is stale. The few values opleet.css carries instead of tokens.json (the type scale, the glass blurs) are mapped by hand in app/app.css. A raw hex colour or pixel value in a class is a review comment.
  • Styling is Tailwind-first outside the existing components. Pages, the shell and any new component use Tailwind with the tokens. The twelve ported components keep their op-* look. Replacing op-* with Tailwind components would be a decision of its own, superseding D8; it is not made here.
  • Biome reads Tailwind's syntax (css.parser.tailwindDirectives), so @theme in app.css parses.
  • One new step, TL-M0-29, installs it and proves it. FE pack C, the shell, waits for it. The Frontend Engineer then extends the tokens script to write theme.css and follows the rules in the design system guide.
  • TL-M0-08 is not edited. It records what was run. A rebuild from an empty folder (D25) runs it as written, then TL-M0-29.