Clone this repo:
  1. a40f8ab Make TreeNode.visit return dynamic. by Sigmund Cherem · 3 months ago master 0.13.2
  2. 959aaed Fix two checked mode bugs introduced by 0.13.0. by Bob Nystrom · 3 months ago 0.13.1
  3. 6e68c51 Bump version to publish 0.13.0. by Bob Nystrom · 3 months ago 0.13.0
  4. c75e20c Fix all strong mode errors and warnings. by Bob Nystrom · 3 months ago
  5. 3cc4042 Add partial support for calc by Terry L. Lucas · 10 months ago 0.12.2

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.

Usage

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 }');
  print(stylesheet.toString());
}

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 https://github.com/dart-lang/csslib-test-suite

cd ../csslib-test-suite
./run.sh