Skip to content

Tailwind #53 — Toolchain + tokens + catalog

FieldValue
GitLabsourcecontrollers/safecall#53
Parent#52 — Bulma → Tailwind CSS platform
Roadmaptailwind-roadmap.md
Depends on— (first migration step)
Workflowopen

Goal

Add Tailwind CSS v4 to the web build alongside Bulma, map the current dark UI into CSS variables + @theme, and ship a small @layer components primitive catalog so later steps swap class names onto a stable agent API — not utility soup or CSS hacks.

Design principles

  1. Prefer catalog primitives for repeated chrome; Tailwind utilities for one-off layout/spacing.
  2. Soft/solid hues are explicit variants (e.g. .tag-info-soft) — never a fragile “light” modifier.
  3. Keep data-theme on <html> (do not switch to class="dark"). Default data-theme="dark" to match today’s permanent dark UI.
  4. No new Bulma markup after this step lands. Existing pages stay Bulma until later IIDs.
  5. Omit Tailwind preflight until #62 so Bulma pages are not reset.

Acceptance criteria

  • [x] tailwindcss + @tailwindcss/cli added to web/package.json
  • [x] CSS source under web/src/css/: tokens.css, app.css, components.css (and optional layout/overrides port stub)
  • [x] Dark-first semantic tokens mapped into Tailwind @theme; light tokens defined for parity/future
  • [x] Component catalog present (btn, tag, notification, modal, field, …) — stubs OK if complete enough for #54–#55
  • [x] web/build.ts compiles Tailwind and serves CSS; Bulma still linked (coexistence; preflight off)
  • [x] Embeds / static asset expectations still pass for existing /css/* paths (update names carefully)
  • [x] Smoke: login + one admin page still work on Bulma

Implementation notes

  • Entry app.css: import theme + utilities only (no @import "tailwindcss/preflight" / full preflight until #62). Follow MetaPrism/Pythia concat order pattern: FA → Bulma → Tailwind → app overrides.
  • Move toward web/src/css/ as source of truth; stop treating web/build/css/styles.css as the only editable file for new work.
  • Map common hex from current dark shells (#0d1117, #161b22, …) into tokens (--sc-page, --sc-surface, --sc-border, --sc-text, semantic hues).
  • Custom dark variant keyed off [data-theme="dark"].
  • Switch <html class="theme-dark"> toward data-theme="dark" only if coexistence still works; if risky, defer the attribute swap to #55/#62 but define tokens for data-theme now.

Component catalog (minimum)

PrimitiveRole
.btn + size/hue/emphasisAction buttons
.tag + solid/soft semanticsStatus chips
.notification + variantsToasts / alerts
.modal / .modal-card / .modal-backdropModals
.field / .label / .control / .input / .select / .checkboxForms
.box / .card / .section / .container / .titleLayout chrome
.navbar / .navbar-item / .navbar-brandShell nav
.table / .table-containerTables
.tabs / .tab + .is-activeTabs
.hiddenVisibility (alias .is-hidden until #62)

Out of scope

WorkIssue
Shared JS helpers / BulmaNotification rename#54
Shell / login / settings markup#55
Remove Bulma / enable preflight#62

Key paths

  • web/package.json
  • web/build.ts
  • web/build/index.html
  • web/src/css/ (new)
  • web/build/css/
  • scripts/build/generators/embeds.ts

Verification

  1. cd web && bun install && bun run build (or project-equivalent web build) succeeds.
  2. Built CSS contains token variables, .btn (or catalog), and Tailwind utilities.
  3. Smoke / login and one listing page (Bulma unchanged visually enough to use).
  4. Typecheck web if touched: cd web && bun run typecheck.

Done when / handoff

  1. Operator verifies → commit with Closes #53 → push gitlab.
  2. Next: #54 shared helpers (activate only when asked).