compile function
StyleSheet
compile(
- Object input, {
- List<
Message> ? errors, - PreprocessorOptions? options,
- bool nested = true,
- bool polyfill = false,
- List<
StyleSheet> ? includes,
Parse and analyze the CSS file.
Implementation
StyleSheet compile(Object input,
{List<Message>? errors,
PreprocessorOptions? options,
bool nested = true,
bool polyfill = false,
List<StyleSheet>? includes}) {
includes ??= [];
var source = _inputAsString(input);
_createMessages(errors: errors, options: options);
var file = SourceFile.fromString(source);
var tree = _Parser(file, source).parse();
analyze([tree], errors: errors, options: options);
if (polyfill) {
var processCss = PolyFill(messages);
processCss.process(tree, includes: includes);
}
return tree;
}