resolveTheme
Resolves a shop's authored theme overrides against the platform defaults into a fully-populated
token map. This is the single default-resolution entry point: the storefront serializer (P3-2)
calls it and never reaches for a literal default itself. A shop with no theme resolves to
exactly, so existing tenants render byte-identically and need no migration.
Accents resolve theme.colors.accents (when non-empty) → design.accents → []: an explicitly-empty
theme.colors.accents falls through to design.accents rather than blanking branding, preserving
the existing accent-source behavior. The four accent light/dark shades are populated only when the
shop overrides them; otherwise they stay absent so the storefront keeps deriving them via colord.
Typography font keys are narrowed against : an authored value that is not an
allowlisted key (stale data, a hand-edited record) falls back to the platform-default font key so
the storefront only ever resolves a family it can statically load via next/font.
Signature
function resolveTheme(shop: ThemeResolutionInput): ResolvedShopTheme;Parameters
| Name | Type | Description |
|---|---|---|
shop | ThemeResolutionInput |
Returns
A fresh with every token populated to a concrete value.
Throws
shop is null or not an object.Related
FeatureFlagService ReviewService ShopService FeatureFlagOption FeatureFlagRef ResolvedCartLineTokens ResolvedProductCardTokens ResolvedShopTheme
productCardCustomProperty
Maps a key to the CSS custom property it serializes to. Aspect knobs target the aspectproductcard namespace; every other knob targets productcard.
ResolvedCartLineTokens
Tenanttunable cartline knobs. Mirrors the productcard token pattern (a flat map serialized difffromdefault onto cartline custom properties) so the cart line is