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

Method declaration_metadata

crates/css_ast/src/properties/mod.rs:307–328  ·  view source on GitHub ↗
(decl: &Declaration<'a, Self, CssMetadata>)

Source from the content-addressed store, hash-verified

305 type ComputedValue = Computed<'a>;
306
307 fn declaration_metadata(decl: &Declaration<'a, Self, CssMetadata>) -> CssMetadata {
308 let mut meta = decl.value.metadata();
309 // Mark this node as a declaration
310 meta.node_kinds |= NodeKinds::Declaration;
311 if decl.important.is_some() {
312 meta.declaration_kinds |= DeclarationKind::Important;
313 }
314 // Check if this is a custom property (dashed ident)
315 if decl.name.is_dashed_ident() {
316 meta.node_kinds |= NodeKinds::Custom;
317 }
318 // Check if the value is unknown
319 if decl.value.is_unknown() {
320 meta.node_kinds |= NodeKinds::Unknown;
321 }
322 // Extract vendor prefix from property name cursor
323 let cursor: Cursor = decl.name.into();
324 meta.vendor_prefixes = CssAtomSet::from_bits(cursor.atom_bits()).try_into().unwrap_or(VendorPrefixes::none());
325 // Declarations always have a name property
326 meta.property_kinds |= PropertyKind::Name;
327 meta
328 }
329
330 fn valid_declaration_name<I>(p: &Parser<'a, I>, c: Cursor) -> bool
331 where

Callers

nothing calls this directly

Calls 4

is_dashed_identMethod · 0.80
metadataMethod · 0.45
is_unknownMethod · 0.45
atom_bitsMethod · 0.45

Tested by

no test coverage detected