resolveTheme

db · /index·functionthrows When

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

@nordcom/commerce-db

Parameters

NameTypeDescription
shopThemeResolutionInput

Returns

A fresh with every token populated to a concrete value.

Throws

When
shop is null or not an object.

FeatureFlagService ReviewService ShopService FeatureFlagOption FeatureFlagRef ResolvedCartLineTokens ResolvedProductCardTokens ResolvedShopTheme

Sourcetheme.ts:602Edit the JSDoc directly
Metadata@nordcom/commerce-db@0.1.0Open in GitHub ↗

On this page