(variables: { name: string; light?: string | undefined; dark?: string | undefined; summary?: string | undefined; }[], theme: { name: string; variables: { name: string; light?: string | undefined; dark?: string | undefined; summary?: string | undefined; }[]; summary?: string | undefined; scheme?: "dark" | ... 2 more ... | undefined; scheme_mirror?: { ...; }[] | undefined; } | null | undefined): { ...; }[] import {apply_theme_variables} from '@fuzdev/fuz_css/variable_graph.js'; Overlays a theme's variables onto a resolved variable set, last-wins by name.
This is how a theme is baked in at build time: the overlaid values flow
through the dependency graph like any other, so the variables a theme
references are pulled in transitively and the output stays tree-shaken. A
stanced theme's scheme_mirror applies first, matching the renderer's order
- and a stanced theme arriving without its mirror computed is resolved
through resolve_theme_stance here, so a hand-rolled theme bakes the same as the shipped exemplars (build time has no bundle-weight concern). A theme slot the stylesheet can't hold is dropped before it overlays, as render_theme_style drops it, so the value beneath it stays.
variables
the resolved default or custom variables
StyleVariable[]theme
the theme to overlay, or null/undefined for none
Theme | null | undefinedreturns
the composed variables, or variables unchanged when there's no theme