W3C-compliant CSS3 parser and scanner
Go
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
LICENSE
NOTES
README.md
ast.go
ast_test.go
doc.go
parser.go
parser_test.go
printer.go
printer_test.go
scanner.go
scanner_test.go
walk.go
walk_test.go

README.md

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.

Caveats

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.