A system-wide modernization of Medable's clinical trial component library, delivering full dark mode, semantic token architecture, automated quality gates, and design-to-code parity across a regulated product suite.

Nucleus powers clinical trial interfaces across 13+ applications: form views, summary panels, and data-dense dashboards where accuracy and clarity are non-negotiable. The library carried visual and technical debt that needed to be addressed systematically.
Dark mode went from broken to production-quality across every component. The solution required a semantic token architecture, not just toggling colors, built around a codified surface elevation model. In light mode, shadows carry depth; in dark mode, shadows disappear, so surfaces must carry it instead.

| Level | Name | Surface token | Shadow | Used for |
|---|---|---|---|---|
| −1 | Sunken | bg-surface-sunken | shadow-inner | Segmented-control track, progress trough |
| 0 | Flush | bg-background | shadow-none | The page itself |
| 1 | Raised | bg-surface | shadow | Cards, table rows, inputs |
| 2 | Floating | bg-surface | shadow-lg | Dropdowns, popovers, tooltips, pickers |
| 3 | Overlay | bg-surface | shadow-2xl | Modal windows and dialogs above a scrim |
Figma variable exports piped through a codegen script into CSS custom properties. One toggle flips the entire system between light and dark.
Standardized on Inter Variable, chosen for open-source licensing and strong handling of dense numeric data in clinical contexts.
Unified icon weight, size, and color behaviour across the component set in both themes.
Systematic contrast, spacing, border, focus-state, and hover-state fixes applied across the full library.
Automated quality gates catch regressions before they ship, replacing slow manual screenshot review.
Used Cursor throughout the modernization pass to ship production component code faster, bridging design intent and implementation.
Full component audit across light and dark, documenting every broken state, inconsistent token, and hardcoded value. Findings were organized into a prioritized tier system to sequence the work without blocking the team.
Designed the semantic token layer before touching a single component. The Figma Variables export became the single source of truth, piped into CSS custom properties that flip between :root and .dark.
Migrated components tier by tier: dark mode foundation first, then typography, iconography, and component-level polish. Used Cursor to accelerate repetitive token substitutions across the codebase.
Built automated visual and accessibility gates so the team ships with confidence instead of relying on manual review. Pre-existing a11y debt was documented in a burn-down allow-list rather than blocking CI immediately.
Published improvements as living documentation inside Storybook: Foundations pages, a Contributing checklist, and a Storybook Improvements report driven from a shared markdown file.