Skip to main content

css_in_js_virtual_stylesheet

Function css_in_js_virtual_stylesheet 

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

Build a virtual stylesheet from the CSS-in-JS tagged templates in a JS/TS source. Each template body is placed at its real line in the source via blank-line padding, so CSS metric line numbers from crate::compute_css_analytics map straight back onto the source. Every ${...} interpolation is masked to a CSS-valid placeholder (newline count preserved so lines after a multi-line interpolation stay aligned). Returns None when the source has no CSS-in-JS tagged template, so callers skip the file entirely (no files_analyzed inflation).