Is there a library out there that will allow me to write the following kind of code, which parses CSS and returns a queryable object model
string input = "p, span { font-family: arial; }";
var cssRules = new Parser().Parse(input);
var rule = cssRules.Find(new Selector("p")).First();
Assert.That(rule.Attribute("font-family").Value, Is.Equal.To("arial"));
I've taken a look at dotless, downloaded their code and examined some of the relevant unit tests and fixtures. It looks promising but I can't quite work out how to use it to parse and query plain CSS.
Assert.That(rule.Attribute("font-family").Value, Is.Equal.To("arial"));
is awfully neat. What library does that come from? – Hygienist