Seeking advice on how to extract rules and property/values from a .css file or <style></style>.
I am not in need of an elaborate parser, as the validity of selector text, property name, or value is not important. My main focus is ensuring that texts are split correctly and disregarding comments.
If possible, examples in C# or VB would be greatly appreciated.
The goal is to gather a collection of rules, with each rule containing selector text and property/value pairs.
Currently, I am able to achieve this using the .NET Webbrowser control. However, if a recognized property cannot be parsed properly, it is excluded. For example,
background-image: linear-gradient(45deg, red, green, blue);
is ignored by the webbrowser control in IE9.
Also, will IE10 be compatible with Win7 upon release? The Microsoft website suggests it will require Win8, creating confusion about needing Win8 just to use the -ms-linear-gradient property.
ETA: Extensive search through assemblies in Reflector did not yield the classes used by the .NET framework to extract css property rules for browsers.