theme_compile.ts

The compile step for a theme: everything derived from it - the stance mirror and the recomputed chroma caps - with the gates and the lint run over that rendering, in one call.

Apart from theme_check.ts so the gates and the caps stay importable without the lint (validate_theme) and the schemas it parses with.

view source

Declarations
#

2 declarations

compile_theme
#

theme_compile.ts view source

(theme: { name: string; variables: { name: string; dark?: string | undefined; base?: string | undefined; summary?: string | undefined; }[]; summary?: string | undefined; scheme?: "dark" | "light" | "dual" | undefined; }): CompiledTheme import {compile_theme} from '@fuzdev/fuz_css/theme_compile.js';

Compiles a theme: computes its stance mirror and its recomputed chroma caps (compute_theme_caps), re-checks the gates with the caps, and lints it. The theme comes back as the same reference and never carries the derived data, so compiling the same theme again gives the same result.

theme

the theme to compile

type Theme

returns

CompiledTheme

the theme with its mirror, caps, gate report, and lint

CompiledTheme
#

theme_compile.ts view source

CompiledTheme import type {CompiledTheme} from '@fuzdev/fuz_css/theme_compile.js';

The output of compile_theme: the input theme with everything derived from it - the stance mirror and the recomputed caps - plus the gate report and lint over that rendering. Renders as render_theme_style(c.theme, c).

inheritance

extends: ResolvedTheme

theme

The input theme, the same reference - compiling never edits it.

type Theme

scheme_mirror

The stance mirror for a single-scheme theme, undefined for a dual one.

type StyleVariable[] | undefined

caps

The _palette_chroma_NN caps recomputed where the baked ones no longer fit the theme's hues and lightness (compute_theme_caps) - empty when they all still fit.

type StyleVariable[]

report

The gates over the theme with its caps, from check_theme.

type ThemeCheckReport

issues

The theme's lint, from validate_theme.

type ThemeIssue[]

Depends on
#