parse function

StyleSheet parse(
  1. dynamic input, {
  2. List<Message>? errors,
  3. PreprocessorOptions? options,
})

Parse the input CSS style sheet into a tree. The input can be a String, or List<int> of bytes and returns a StyleSheet AST. The optional errors list will contain each error/warning as a Message.

Implementation

StyleSheet parse(input, {List<Message>? errors, PreprocessorOptions? options}) {
  var source = _inputAsString(input);

  _createMessages(errors: errors, options: options);

  var file = SourceFile.fromString(source);
  return _Parser(file, source).parse();
}