Skip to main content

sfc_virtual_stylesheet

Function sfc_virtual_stylesheet 

Source
pub fn sfc_virtual_stylesheet(source: &str) -> Option<String>
Expand description

Build a “virtual stylesheet” from an SFC’s plain-CSS <style> blocks (any scoping). Each block body is placed at its real line in the SFC via blank-line padding, so CSS metric line numbers from compute_css_analytics map straight back onto the SFC. Returns None when the SFC has no plain-CSS <style> block (e.g. only lang="scss" blocks, which the CSS parser cannot read), so callers run the standard .css metric path on Vue/Svelte component styles.