CSSTree – tool set for CSS

CSSTree is a tool set for CSS: fast detailed parser (CSS → AST), walker (AST traversal), generator (AST → CSS) and lexer (validation and matching) based on specs and browser implementations.

The main goal is to be efficient and W3C spec compliant, with focus on CSS analyzing and source-to-source transforming tasks.

This is free and open source software.

Key Features

  • Detailed parsing with an adjustable level of detail – by default CSSTree parses CSS as detailed as possible, i.e. each single logical part is representing with its own AST node (see AST format for all possible node types).
  • Tolerant to errors by design.
  • Fast and efficient – created with focus on performance and effective memory consumption.
  • Syntax validation – the built-in lexer can test CSS against syntaxes defined by W3C. CSSTree uses mdn/data as a basis for lexer’s dictionaries and extends it with vendor specific and legacy syntaxes. Lexer can only check the declaration values and at-rules currently, but this feature will be extended to other parts of the CSS in the future

Website: github.com/csstree/csstree
Support:
Developer: Roman Dvornov
License: MIT License

CSSTree is written in JavaScript. Learn JavaScript with our recommended free books and free tutorials.


Related Software

CSS Parsers
PostCSSTransform styles with JavaScript plugins
Lightning CSSParser, transformer, bundler, and minifier
ReworkPlugin framework for CSS preprocessing
MenschNon-validating CSS parser
CSSTreeTool set for CSS
StylisLightweight CSS preprocessor
tinycss2CSS parser and generator
LibCSSCSS parser and selection engine
Ruby CSS ParserLoad, parse and cascade CSS rule sets
ParserLibCSS3 SAX-inspired parser
css-parserFork of the cssutils project
StylecowModern CSS to all browsers
Gonzales PECSS parser which plays nicely with preprocessors
CSSOMCSS parser written in pure JavaScript

Read our verdict in the software roundup.


Best Free and Open Source Software Explore our comprehensive directory of recommended free and open source software. Our carefully curated collection spans every major software category.

This directory is part of our ongoing series of informative articles for Linux enthusiasts. It features hundreds of detailed reviews, along with open source alternatives to proprietary solutions from major corporations such as Google, Microsoft, Apple, Adobe, IBM, Cisco, Oracle, and Autodesk.

You’ll also find interesting projects to try, hardware coverage, free programming books and tutorials, and much more.

Know a useful open source Linux program that we haven’t covered yet? Let us know by completing this form.
Subscribe
Notify of
guest
0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments