#css #css-parser #parser

css_ast

CSS Abstract Syntax Trees with visitable nodes and style value types

12 releases

Uses new Rust 2024

new 0.0.7 Dec 6, 2025
0.0.7-canary.f08affa44d Oct 27, 2025

#117 in Procedural macros


Used in 4 crates

MIT license

4MB
44K SLoC

css_ast

CSS Abstract Syntax Trees with visitable nodes and style value types.

📖 Full Documentation

Features

  • Complete AST definitions: Generated and handwritten node types for all CSS constructs
  • Visitable nodes: Implement visitor patterns for AST traversal and transformation
  • CSS value types: Comprehensive support for all CSS value types
  • Property definitions: Type-safe representations of CSS properties
  • Generated from spec: Many value definitions automatically generated from CSS specifications
  • Feature gates: Optional dependencies for chromashift, miette, serde support

Optional Features

  • visitable - Enables visitor pattern support for AST traversal
  • chromashift - Enables color conversion utilities
  • miette - Enables rich diagnostic integration
  • serde - Enables serialization/deserialization support

Part of csskit

This crate is part of the csskit project, a comprehensive CSS toolchain.

For more information, visit csskit.rs.

License

MIT

Dependencies

~3–17MB
~201K SLoC