I've had a look around and seen a few PHP CSS parsers, but so far they just seem to be for parsing an individual file. What I am wanting to do is read in all of the CSS for a document (from individual files and specified within the HTML - I'm not concerned about JavaScript for now) and check the values of the final overriding CSS. Has anyone ever come across something quite like this? Before I dive into coding something myself for it, I thought I would check.
Let me get this right, you want to check the actual css elements values for each rule to compare with something?
So the process would be: Read the HTML file -> read in CSS (from files and within the document) -> check a particular HTML tag for an ID/class(es) -> grab the CSS elements and their values and compare them (only the "predominent" ones, not any that have been overriden) against something (like if background-color is set to #00000). I've seen some PHP scripts for helping to parse CSS, but so far just for individual files. I'm looking to do it on a bigger scope, so if there's nothing pre-existing I'll just write it myself.
Yeah, the conclusion I'm coming to after searching a lot. A fun little challenge for while I'm on night shift. I wonder if a parser for multiple files (including CSS within the HTML) would be useful for anyone else.