Adopt Life Design System
Migrate an existing Sarvam screen or flow to Life Design System components and tokens while preserving behavior. Use when the user asks to adopt Life, adopt the design system, or replace legacy UI with shared Life components — there is no separate opt-in CSS bundle or `.life` wrapper scope.
Production-ready: PRODUCTION_READY.md · Index. Adoption preserves behavior first; when promotion creates or changes packages/life/src exports, run the checklist (or component-cycle) before treating the component as production-ready.
Life is the Sarvam-wide design system (this repository). Adoption means importing shippable packages/life/src React components and generated tokens in product apps (including Software Factory) — not copying HTML catalog specimens into production or toggling a legacy life.css shim.
Establish the baseline
Read AGENTS.md and Life DESIGN.md. Inspect the target route through its normal entry point. Record flows, responsive layout, states, and keyboard behavior to preserve. Use existing tests and preview the screen when you can.
Tokens and theme
- Single pipeline: DTCG sources in
packages/life/design-system/tokens/+sarvam.resolver.json; runnpm run tokensto regeneratepackages/life/design-system/tokens.cssandpackages/life/design-system/tokens/tokens.figma.json(generated Figma sync — notlife.figma.json). - Use
--sv-*custom properties fromtokens.css(--sv-content-*,--sv-background-*,--sv-border-*, spacing, radius, type scales). Do not reference removedlife.cssor global--sv-text-{semanticRole}aliases. - Light is default (
:root,data-theme="light"). Dark uses[data-theme="dark"]on the document root (or an ancestor). Verify both when the surface supports themes.
Map and migrate
- Find shippable implementations in
packages/life/srcand product apps; use Studio catalog React previews (apps/studio/src/lib/life-specimens/previews/) as references, not drop-in UI. - Map legacy styles by role to semantic tokens. Use the surface roles in visual-direction (ground / surface / tray) to decide which background and border each legacy panel becomes; drop legacy shadows. Keep one-offs local and note missing components or token roles.
Icons: Hugeicons Stroke Standard by default, Solid Standard only for filled/active states; logos/brand marks may stay SVG. No Rounded, free-tier, or third-party icon sets (
tests/icons-import-policy.test.mjs). Focus: Visible:focus-visiblerings use neutral greyscale tokens only (--sv-border-focus,--sv-focus-on-light/--sv-focus-on-dark) — never accent palette colours on focus. - Promote shared wrappers into
packages/life/src/<Name>/per Componentize when a prototype already duplicated a recipe. Re-export from the old path; do not leave two implementations. - Token or primitive changes follow
AGENTS.md(Figma → specimens → comparison board) in separate scope.
Verify and hand off
Re-walk affected paths: viewports, light and dark, keyboard. Run relevant tests (focus-css-allowed, icon policy, component tests). Report route, components adopted, token roles used, and any remaining local overrides or gaps.
In the catalog, prefer entries with the green dot (React in @sarvam/life meeting PRODUCTION_READY.md). Specimens without the dot are HTML-only until packages/life/src ships the bar. Orange T = Tatva parity, not production-ready.
After any colour or token change, run pnpm tokens:validate and report failures (such as a dark-theme contrast miss) rather than hiding them. Figma Life / Primitives and comparison-board sync is a separate required step; say plainly if it was not done.