@wasd/design-system-foundation
v0.6.0
Published
Single source of truth for WASD foundation tokens.
Readme
@wasd/design-system-foundation
Single source of truth for WASD foundation tokens.
Foundation value domains live as top-level files in src (for example,
src/color.ts). src/index.ts assembles those domains into the foundation
theme contract with createGlobalThemeContract from @vanilla-extract/css.
Component token contracts are owned by their component packages. For example,
button tokens are exported from @wasd/design-system-button/tokens.
Entry Points
@wasd/design-system-foundationexports foundation token objects,foundationTheme,foundationVar, token helpers, and the typed vanilla-extract foundation contract.
Named theme CSS packages also target the same token contract:
@wasd/design-system-theme-vorlaut/cssprovides the default playful WASD theme.@wasd/design-system-theme-frankfurt/cssprovides a high-contrast grayscale theme.
Each named theme supports data-wasd-color-scheme="light",
data-wasd-color-scheme="dark", and user-preference mode when that attribute is
omitted.
Design-system packages re-export token metadata from this package. Runtime token values are owned by named theme packages.
Theme Authoring Types
Use WasdFoundationTheme for the complete foundation part of a theme. The
generic theme framework lives in @wasd/design-system-theme; this package owns
the foundation slot and augments WasdTheme when imported. Domain types are
also exported when a theme author wants to work on one area at a time:
WasdColorThemeWasdSpacingThemeWasdDimensionThemeWasdShapeThemeWasdEffectThemeWasdMotionThemeWasdSkeletonThemeWasdLayoutThemeWasdTypographyTheme
WasdThemeFromTokens<TTokens> is the generic helper behind those names. It maps
a token definition tree to the string values a runtime theme must provide.
