CSS selector parser, DOM query engine
Selery is a small, artisanal CSS selector parser and DOM query engine. I aimed for a straightforward implementation that’s easy to understand, fork, and tinker with.
It underpins things like QSX, a query language based on CSS selector syntax. It can also provide support for modern CSS selectors in non-browser DOM environments such as jsdom.
Full documentation available on the project’s GitHub repository page.
Some relevant CSS specifications
- CSS Syntax Module Level 3 for general tokenizing and parsing.
- CSS Selectors Level 4 for selector grammar.
- CSS Object Model (CSSOM) for serialization.
Try it out here:
Colophon
The Selery wordmark is typeset in Manicotti, the reverse-stressed Spaghetti Western typeface by David Jonathan Ross.