[ANN] css-parser: a parser for CSS Syntax Module Level 3

This library provides a parser that conforms to CSS Syntax Module Level 3. It parses strings containing CSS stylesheets, and produces an AST conforming to the W3C specs (see https://github.com/astrada/ocaml-css-parser/blob/master/lib/types.mli). The specs are fully implemented, but there are still probably bugs. If your stylesheet doesn’t parse correctly, please open an issue on github.

I wrote this parser as part of ppx_bs_css, but there was some interest in having it as a separate library. So I published it on opam. To install it:

opam install css-parser

Hope you find it useful!

15 Likes

@astrada Can’t say thank you enough for making this and being so helpful responding to issues on GitHub! This parser was instrumental in allowing me to create tailwind-ppx; css-parser certainly has my stamp of approval :smile:

5 Likes