CSS Structs

A Rust library for working with CSS.

Rust
nom
Parser
Code example parsing CSS with Stylesheet::from_string and round-tripping it back to a string

Overview

I built CSS Structs because I wanted to learn a bit about parsing and needed a CSS parser for my SVG optimization project. It's by no means a complete parser that supports the entire standard - it does what I needed it to do at the time. The library lets you parse CSS to structs, make changes, and turn it back into a stylesheet.