Re: tinycss: a new CSS parser for Python

On Thu, Apr 5, 2012 at 7:23 PM, Simon Sapin <simon.sapin@kozea.fr> wrote:

> Hi www-style,
>
> I’m happy to announce the first release of tinycss, a complete yet simple
> CSS parser for Python. It supports the full syntax and error handling for
> CSS 2.1 as well as some CSS 3 modules:
>
> * Selectors 3 (can also find matching elements in a lxml document)
> * CSS Color 3
> * CSS Paged Media 3
>
> It is designed to be easy to extend for new CSS modules and syntax.
>
> Documentation: http://packages.python.org/**tinycss/<http://packages.python.org/tinycss/>
> Source: https://github.com/SimonSapin/**tinycss/<https://github.com/SimonSapin/tinycss/>
>
> The API is not based on SAC or CSSOM, but rather on what I felt was useful
> for WeasyPrint and CairoSVG (rendering engines for HTML and SVG
> respectively, that both support CSS).
>
> I made the choice not to parse property values: each UA will support a
> different set of properties and values, they need to filter unsupported
> declarations themselves to have proper fallback.
>
> Anyway. Source code, tests and documentation are available. Any feedback
> is appreciated.
>
> Thanks,
> --
> Simon Sapin
>
> Thanks for sharing :)

How easily can it be extended? Eg to implement a superset of css (such as
scss).

J. Leclanche

Received on Friday, 6 April 2012 15:48:43 UTC