A CSS3 SAX-inspired parser written in JavaScript for parsing and validating CSS syntax.
CSS Parser is a JavaScript library that parses and validates CSS3 syntax using a SAX-inspired event-driven model. It processes CSS text, fires events for constructs like rules and properties, and supports error recovery similar to browsers. It's designed as a foundation for building CSS linters, validators, and other tooling.
JavaScript developers building CSS analysis tools, linters, validators, or preprocessors that require detailed parsing of CSS syntax.
Developers choose this parser for its browser-like error recovery, detailed event system for granular control, and support for CSS3 features like media queries and keyframes, all without imposing a specific abstract syntax tree structure.
Collection of parsers written in JavaScript
The SAX-inspired model fires events for CSS constructs like rules and properties, allowing developers to build custom tools without being locked into a specific AST, as shown in the extensive event handling examples.
Recovers from syntax errors by skipping invalid properties or rules, mimicking browser behavior, which is crucial for parsing real-world, messy CSS code.
Provides structured objects for media queries, selectors, and properties with line and column info, enabling precise analysis for linters or validators.
Supports options for star/underscore hacks and IE filters, allowing customization for legacy codebases, as documented in the constructor options.
The README admits it's 'not guaranteed to thoroughly validate all possible CSS properties,' limiting its reliability for thorough linting without additional checks.
Requires developers to construct their own data structures from events, adding complexity and development time compared to parsers that provide a ready-to-use AST.
Focused on CSS3 syntax and may lack support for newer CSS features like Grid or Custom Properties, and the reliance on Travis CI suggests limited recent updates.
Transforming styles with JS plugins
Plugin framework for CSS preprocessing in Node.js
A tool set for CSS including fast detailed parser, walker, generator and lexer based on W3C specs and browser implementations
CSS parser with support of preprocessors
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.