What's the best way to parse a css file, and get a list of all the css (using @imports), and the images that are referenced as background-images etc? Is there any parser for css available in ruby??
A:
We use LESS CSS to parse stylesheets to validate their syntax among other things.
require 'less'
Less.parse "div { width: 1 + 1 }"
Andy Atkinson
2010-08-17 03:24:35