calc(), and the JavaScript runtime solves APCA contrast against the actual surface and writes the results back as custom properties. APCA attribution and use restrictions: see About APCA.
Getting the CSS
The pipeline writes intogenerated/, with globally shared artifacts under generated/global/ and per-brand artifacts under generated/brands/<brand>/<sub-brand>/. Load the barrel once at your app entry — it pulls in the layer definitions, the token layer, the @property declarations, the role selectors, every brand’s CSS, the component styles, and the CVD pattern overlays:
initializeSubstrate() defaults to the first registry brand and defaultPreferences(), accepts { brand, preferences } overrides, and is exactly equivalent to the lower-level sequence:
substrate setup path generates this module for you as src/substrate.setup.ts. Full detail on the call sequence and the alias contract is on the Runtime & Imports page; nested surfaces need the Surface component.
Using it in your CSS
Opt an element into the cascade withdata-ucs and give it a role:
Other output targets
CSS is one target among several. The same brand model is emitted as DTCG JSON (the W3C design-token format, for Tokens Studio and Style Dictionary), Swift, Kotlin/Compose, React Native, Xcode asset catalogs, and JSON conformance vectors used to hold the native kernel ports to the TypeScript kernel’s behavior.Runtime & Imports
The runtime call sequence and the three import aliases.
Surface Component
Re-solving contrast against a nested surface’s own background.
iOS / Swift
Per-mode Display P3 token files and the SubstrateKernel package.