MCPcopy Create free account
hub / github.com/csskit/csskit / specificity

Method specificity

crates/css_ast/src/selector/functional_pseudo_class.rs:331–343  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

329
330impl<'a> ToSpecificity for FunctionalPseudoClass<'a> {
331 fn specificity(&self) -> Specificity {
332 match self {
333 Self::Where(_) => Specificity(0, 0, 0),
334 Self::Is(f) => f.value.specificity(),
335 Self::Not(f) => f.value.specificity(),
336 Self::Has(f) => f.value.specificity(),
337 Self::Host(f) => f.value.specificity(),
338 Self::HostContext(f) => f.value.specificity(),
339 Self::NthChild(_) | Self::NthLastChild(_) => Specificity(0, 1, 0),
340 Self::NthOfType(_) | Self::NthLastOfType(_) | Self::NthCol(_) | Self::NthLastCol(_) => Specificity(0, 1, 0),
341 Self::Dir(_) | Self::Lang(_) | Self::State(_) | Self::Heading(_) => Specificity(0, 1, 0),
342 }
343 }
344}
345
346#[cfg(test)]

Callers

nothing calls this directly

Calls 1

SpecificityClass · 0.50

Tested by

no test coverage detected