var().
Stylesheet
Link
tokens.css and reference custom properties. Switching brand is one href change.Values in JS
Fetch
tokens.values.json for libraries that compute on values. Switching brand means
re-fetching.Build time
Pull the DTCG document in CI and generate. No runtime dependency on Livry at all.
The principle worth internalising
Your app should hold no values — only
var() references.If every colour in your theme configuration is var(--color-brand, #5B4DE4) rather than
#5B4DE4, then swapping the stylesheet rebrands the entire application and nothing re-renders.
The browser recomputes custom properties on its own.Every guide below is a way of getting your particular library to hold references instead of values.Pick your guide
Libraries that compute on values
Some libraries derive shades, hover states or contrast ratios from a colour in JavaScript. Those cannot take avar() — they need a real value — so they read tokens.values.json:
Where the variable names come from
A token path becomes a custom property by hyphen-joining it, with the Theme’s optional prefix in front:assetSettings.prefix.
Server-rendered apps
Everything above works server-side too, and it is usually simpler: you know the tenant at render time, so write the right<link> and never switch anything.
Put the Livry
<link> before your own stylesheets, so the custom properties are defined before
the rules referencing them are evaluated on first paint.Your Theme’s real URLs
Every guide here uses placeholders. Your actual URLs — with real ids, and listing only the files your Theme builds — are on the Theme’s Integration tab in the portal, and on the API asservingUrls. The portal also generates these snippets pre-filled with your ids.