replaceSync method
dynamic
replaceSync(})
Synchronously replaces the content of the stylesheet with the content passed into it.
Implementation
replaceSync(String text, {required double windowWidth, required double windowHeight, required bool? isDarkMode}) {
cssRules.clear();
// Preserve href so relative URLs continue to resolve correctly after replace.
List<CSSRule> rules = CSSParser(text, href: href)
.parseRules(windowWidth: windowWidth, windowHeight: windowHeight, isDarkMode: isDarkMode);
cssRules.addAll(rules);
}