parseExternalCss function
Map<String, Map<String, List<Expression> > >
parseExternalCss(
- String css,
- OnCssParseError? errorHandler
Implementation
Map<String, Map<String, List<css.Expression>>> parseExternalCss(String css, OnCssParseError? errorHandler) {
var errors = <cssparser.Message>[];
final sheet = cssparser.parse(css, errors: errors);
if (errors.isEmpty) {
return DeclarationVisitor().getDeclarations(sheet);
} else if (errorHandler != null) {
String? newCss = errorHandler.call(css, errors);
if (newCss != null) {
return parseExternalCss(newCss, errorHandler);
}
}
return {};
}