css-parser is a complete TypeScript library for parsing, validating, transforming and aggressively optimizing stylesheets._
CSS has evolved considerably. Modern stylesheets contain nested rules, custom properties, advanced color functions and increasingly sophisticated syntax. Processing them requires more than a collection of regular expressions and string replacements.
css-parser is a TypeScript library designed to understand and process CSS at a structural level. It combines parsing, validation, transformation and minification in a single package, with an extensible, strongly typed AST API for developers building their own CSS tools.
Beyond parsing and minification
css-parser provides a comprehensive set of tools for working with CSS:
Parsing: A fault-tolerant parser based on the CSS Syntax Module Level 3 specification.
Validation: CSS validation using W3C specification data.
Transformation: CSS nesting, modern color functions, custom functions, mixins and other syntax…