rgrove/crass: A Ruby CSS parser that's fully compliant with the CSS Syntax Level 3 specification.

03-Jul-2026 10
A Ruby CSS parser that's fully compliant with the CSS Syntax Level 3 specification.Pure Ruby, with no runtime dependencies other than Ruby 1.9.x or higher. Tokenizes and parses CSS according to the rules defined in the 14 November 2014 editor's draft of the CSS Syntax Level 3 specification. Extremely tolerant of broken or invalid CSS. If a browser can handle it, Crass should be able to handle it too. Optionally includes comments in the token stream. Optionally preserves certain CSS hacks, such as the IE "*" hack, which would otherwise be discarded according to CSS3 tokenizing rules. Capable of serializing the parse tree back to CSS while maintaining all original whitespace, comments, and indentation.
Use coupon code:

RUBYONRAILS

to get 30% discount on our bundle!
Prepare for your next tech interview with our comprehensive collection of programming interview guides. Covering JavaScript, Ruby on Rails, React, and Python, these highly-rated books offer thousands of essential questions and answers to boost your interview success. Buy our 'Ultimate Job Interview Preparation eBook Bundle' featuring 2200+ questions across multiple languages. Ultimate Job Interview Preparation eBook Bundle