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<(), ParserError>
pub fn validate_theme_tokens( &self, theme: &TokenFile, ) -> Result<(), ParserError>
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.
Trait Implementations§
Source§impl Clone for CssTokenAnalysis
impl Clone for CssTokenAnalysis
Source§fn clone(&self) -> CssTokenAnalysis
fn clone(&self) -> CssTokenAnalysis
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CssTokenAnalysis
impl Debug for CssTokenAnalysis
impl Eq for CssTokenAnalysis
Source§impl PartialEq for CssTokenAnalysis
impl PartialEq for CssTokenAnalysis
impl StructuralPartialEq for CssTokenAnalysis
Auto Trait Implementations§
impl Freeze for CssTokenAnalysis
impl RefUnwindSafe for CssTokenAnalysis
impl Send for CssTokenAnalysis
impl Sync for CssTokenAnalysis
impl Unpin for CssTokenAnalysis
impl UnsafeUnpin for CssTokenAnalysis
impl UnwindSafe for CssTokenAnalysis
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more