A CSS level 3 parser written in pure Nim
  • Nim 99%
  • CSS 1%
Find a file
2026-06-30 13:04:06 +05:30
examples fix: strip x bit from all files 2026-05-25 21:53:12 +05:30
src xxx: remove pretty import 2026-06-30 13:03:45 +05:30
testing_data (add) nth parser 2024-05-02 16:47:29 +05:30
tests fix: strip x bit from all files 2026-05-25 21:53:12 +05:30
.gitignore add: gitignore and license 2026-05-26 15:54:41 +05:30
LICENSE add: gitignore and license 2026-05-26 15:54:41 +05:30
neo.toml bump: 0.1.4 -> 0.1.5 2026-06-30 13:04:06 +05:30
README.md fix: strip x bit from all files 2026-05-25 21:53:12 +05:30
stylus.nimble bump: 0.1.4 -> 0.1.5 2026-06-30 13:04:06 +05:30

Stylus -- a CSS level 3 parser written in pure Nim

Stylus is mostly a rewrite of rust-cssparser in Nim (for now) and it aims to support the entire CSS3 specification.
The tokenizer and parser are mostly done, but a few functions and missing.

The Parser

The parser is not designed to hand over a proper rule vector to you - you're supposed to build one yourself! The parser simply gives you the tools to gracefully parse a CSS3 stylesheet. This allows for a flexible range of syntax that might not be prescribed in the actual spec.

Users

Stylus is currently used by:

  • ferus, a web engine written in Nim (here)
  • figuro, a UI toolkit for Nim (here)

Have a project that uses Stylus? Let me know!