parse function

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

Parse the input CSS stylesheet into a tree.

The input can be a String, or List<int> of bytes and returns a StyleSheet AST. The optional errors list will collect any error encountered.

Implementation

StyleSheet parse(
  Object 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();
}