- Status: Accepted
- Date: 2026-03-24
Context#
OSHUN already had two overlapping visual-token layers:
libs/oshun/design-tokensdefined the shared theme primitivesapps/oshun/web/src/design-system/tokens.tsredefined richer web-specific spacing, typography, motion, and elevation values
That split made the product look coherent in practice, but it left the V1 visual system under-specified. The TODO list explicitly requires one V1 token definition for color, typography, spacing, elevation, and motion. The product brief also requires one consistent design language across customer and admin surfaces.
Decision#
Publish one canonical V1 foundation token bundle from
libs/oshun/design-tokens/src/tokens.ts and make the web design system consume
that shared bundle instead of re-inventing the same primitives locally.
The V1 foundation includes:
-
Color foundations
- neutral
inkandfogscales - shared signal and status scales
- canonical domain seed accents
- neutral
-
Typography foundations
- display, body, and mono families
- explicit
regular,medium,semibold,bold, andextraboldweights - numeric editorial scale for shared theme contracts
- fluid ramp for web rendering
-
Spacing foundations
- one 4px-derived spacing scale from
0through96 - alias steps (
xxsthrough3xl) preserved for shared-theme compatibility
- one 4px-derived spacing scale from
-
Elevation foundations
- canonical shadow ladder from
nonethroughxl - border-first dark-surface elevation rather than card-heavy chrome
- canonical shadow ladder from
-
Motion foundations
- canonical duration ladder from
instantthroughslower - standard, entrance, exit, spring, emphasized, and linear easing tokens
- travel-distance and scale tokens used by shared motion helpers
- canonical duration ladder from
Consequences#
libs/oshun/design-tokensbecomes the source of truth for the V1 foundation.apps/oshun/web/src/design-system/tokens.tsbecomes an adapter layer instead of a second foundation definition.- Studio design-language tooling can inspect the actual live bundle, including bundle id, visual thesis, semantic roles, type ramp, spacing, elevation, and motion cadence.
libs/oshun/ui/src/motion/transitions.tsnow consumes tokenized motion travel and scale values instead of hardcoded distances.
Implementation#
- Shared bundle:
libs/oshun/design-tokens/src/tokens.ts
- Shared bundle verification:
libs/oshun/design-tokens/src/tokens.test.tslibs/oshun/design-tokens/src/theme-regression.test.ts
- Shared motion helper consumption:
libs/oshun/ui/src/motion/transitions.tslibs/oshun/ui/src/motion/transitions.test.ts
- Web adapter:
apps/oshun/web/src/design-system/tokens.tsapps/oshun/web/src/design-system/index.tsapps/oshun/web/src/design-system/globals-v2.cssapps/oshun/web/src/design-system/__tests__/tokens.test.ts
- Studio inspection surface:
apps/oshun/web/src/components/studio/StudioDesignLanguageWorkspace.tsxapps/oshun/web/src/components/__tests__/StudioDesignLanguageWorkspace.test.tsxapps/oshun/web/e2e/studio-design-language-smoke.spec.ts
Verification#
This slice is complete when:
- Shared token-library tests pass.
- Shared UI motion-library tests pass.
- Web design-language and token-adapter tests pass.
- Playwright verifies
/studio/design-languagerenders the V1 foundation preview and governance controls.