Clone this repo:
  1. 8d73c0e Updates version (#55) by Leon Senft · 2 days ago master 0.13.7
  2. cf59331 Restricts examples test to VM due to file I/O (#54) by Leon Senft · 6 days ago
  3. 4eb2b17 Added a samples test to test csslib on common css frameworks (#51) by Jarrett Tierney · 6 days ago
  4. 22a3519 Supports at-rules nested within at-rules (#52) by Leon Senft · 7 days ago
  5. b9e1ed8 Supports mixing /* */ and <!-- --> comments (#53) by Leon Senft · 7 days ago

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