MCPcopy Create free account
hub / github.com/Stranger6667/css-inline / find_style_value

Function find_style_value

css-inline/src/html/serializer.rs:114–120  ·  view source on GitHub ↗
(styles: &'a ElementStyleMap<'_>, property: &str)

Source from the content-addressed store, hash-verified

112/// Find a style property value from stylesheet rules (not pre-existing inline styles).
113#[inline]
114fn find_style_value<'a>(styles: &'a ElementStyleMap<'_>, property: &str) -> Option<&'a str> {
115 styles
116 .iter()
117 .rev()
118 .find(|(name, _, _)| *name == property)
119 .map(|(_, _, value)| *value)
120}
121
122/// Find a property value in an element's inline `style` attribute (last declaration wins).
123fn find_inline_style_value<'a>(style: &'a str, property: &str) -> Option<&'a str> {

Callers 1

start_elemMethod · 0.85

Calls 2

findMethod · 0.80
iterMethod · 0.80

Tested by

no test coverage detected