pub struct CssTokenAnalysis {
pub protocol_tokens: Vec<String>,
pub fallback_chains: Vec<CssFallbackChain>,
/* private fields */
}Expand description
CSS token analysis produced from the parsed template/component graph.
Fields§
§protocol_tokens: Vec<String>Sorted, deduplicated token candidates stored in the protocol.
fallback_chains: Vec<CssFallbackChain>Fallback chains that still need theme/literal coverage after local and ancestor custom-property definitions are considered.
Implementations§
Source§impl CssTokenAnalysis
impl CssTokenAnalysis
Sourcepub fn validate_theme_tokens(&self, theme: &TokenFile) -> Result<()>
pub fn validate_theme_tokens(&self, theme: &TokenFile) -> Result<()>
Validate the required CSS tokens against a loaded design-token theme.
A token is required in every theme only when it appears in at least one
unresolved var() chain with no literal CSS fallback. A chain such as
var(--x, 16px) provides its own value, so --x stays in
protocol_tokens for runtime resolution (the
theme value still wins when present) but does not fail the build when the
theme omits it. The chain/theme policy lives in
webui_tokens::validate_chain_tokens; this only adapts its
webui_tokens::TokenError into a structured Diagnostic.
§Errors
Returns ParserError::Template with a stable diagnostic code when a
required token is missing from a theme. Theme token values are trusted and
their transitive references are left to browser CSS semantics.
Sourcepub fn unthemed_literal_fallback_tokens(&self, theme: &TokenFile) -> Vec<String>
pub fn unthemed_literal_fallback_tokens(&self, theme: &TokenFile) -> Vec<String>
CSS tokens used only with a literal var() fallback and defined in no
theme — likely typos that callers may surface as non-fatal advisories.
Thin wrapper over webui_tokens::unthemed_literal_fallback_tokens.
Sourcepub fn theme_token_warnings(&self, theme: &TokenFile) -> Vec<Diagnostic>
pub fn theme_token_warnings(&self, theme: &TokenFile) -> Vec<Diagnostic>
Structured, color-free advisories for CSS tokens used only with a
literal var() fallback and defined in no theme — almost always typos.
Returned as warning-severity Diagnostics so hosts render them with
the same location/snippet/help: layout as errors (the CLI colorizes;
other hosts use the plain Diagnostic::body). Each carries the token’s
source location and a did you mean --…? suggestion.