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

Method styles

css-inline/src/html/document.rs:118–124  ·  view source on GitHub ↗

Iterator over blocks of CSS defined inside `style` tags.

(&self)

Source from the content-addressed store, hash-verified

116
117 /// Iterator over blocks of CSS defined inside `style` tags.
118 pub(crate) fn styles(&self) -> impl Iterator<Item = (NodeId, &str)> + '_ {
119 self.styles.iter().filter_map(|node_id| {
120 self[*node_id]
121 .first_child
122 .and_then(|child_id| self[child_id].as_text().map(|text| (*node_id, text)))
123 })
124 }
125
126 /// Iterate over `href` attribute values of `link[rel~=stylesheet]` tags.
127 pub(crate) fn stylesheets(&self) -> impl Iterator<Item = &str> + '_ {

Callers 2

inline_to_implMethod · 0.80
test_collect_stylesFunction · 0.80

Calls 2

iterMethod · 0.80
as_textMethod · 0.80

Tested by 1

test_collect_stylesFunction · 0.64