W3C-compliant CSS3 parser and scanner
Latest commit 6538f86 Dec 13, 2014 @benbjohnson README
Failed to load latest commit information.
NOTES NOTES Jul 29, 2014
README.md README Dec 14, 2014
ast.go Consolidate into single package. Aug 12, 2014
ast_test.go Add AST test coverage. Aug 16, 2014
doc.go godoc Aug 16, 2014
parser.go Complete test coverage. Aug 16, 2014
parser_test.go Add parser test coverage. Aug 16, 2014
printer.go Add printer test coverage. Aug 16, 2014
printer_test.go go vet Aug 16, 2014
scanner.go Refactor scan() into a switch/case. Aug 17, 2014
scanner_test.go go vet Aug 16, 2014
walk.go Refactor parser tests. Aug 14, 2014
walk_test.go TODO Aug 14, 2014


css Build Status Coverage Status GoDoc Project status

This package provides a CSS parser and scanner in pure Go. It is an implementation as specified in the W3C's CSS Syntax Module Level 3.

For documentation on how to use this package, please see the godoc.

Project Status

The scanner and parser are fully compliant with the CSS3 specification. The printer will print nodes generated from the scanner and parser, however, it is not fully compliant with the CSS3 serialization spec. Additionally, the printer does not provide an option to collapse whitespace although that will be added in the future.

This project has 100% test coverage, however, it is still a new project. Please report any bugs you experience or let me know where the documentation can be clearer.


The CSS scanner in this package only supports UTF-8 encoding. The @charset directive will be ignored. If you need to scan a different encoding then please convert it to UTF-8 first using a tool such as iconv.