Skip to main content

scope_css

Function scope_css 

Source
pub fn scope_css(css: &str, id: &str) -> String
Expand description

Scope CSS by inserting .{id} before any pseudo-class/pseudo-element on the last simple selector of each rule.

Input: .card { border: 1px solid; } a:hover { color: navy; } Output: .card.a1b2c3d4 { border: 1px solid; } a.a1b2c3d4:hover { color: navy; }