Fix all strong mode errors and warnings.

This is almost all:

- Adding type annotations to empty lists that are later filled. Many
  of these could be simplified by using .map(...).toList() to create
  the list instead, but I wanted to minimize my changes.
- Adding type arguments to some List annotations.

I did find one thing that I believe was a bug where a list was being
inadvertently flattened. Strong mode caught that.

Review URL: .
20 files changed
tree: 49bfa5232d37b0bc61462060950574ef3c10c865
  1. bin/
  2. example/
  3. lib/
  4. test/
  5. .analysis_options
  6. .gitignore
  7. .test_config
  9. codereview.settings
  11. pubspec.yaml

CSS parser library for Dart

This is a CSS parser written entirely in Dart. It can be used in the client/server/command line.

This package is installed with Pub, see: install instructions for this package.


Parsing CSS is easy!

import 'package:csslib/parser.dart' show parse;
import 'package:csslib/css.dart';

main() {
  var stylesheet = parse(
      '.foo { color: red; left: 20px; top: 20px; width: 100px; height:200px }');

You can pass a String or list of bytes to parse.

Running Tests

Basic tests can be found in this repository:

pub run test

The full CSS test suite can be found in

cd ../csslib-test-suite