CSS equivalent comparison or consolidation?
Are there any online (or offline) tools where you can plugin in two sets of CSS styles and it will tell you if they are equivalent or not?
开发者_JAVA技巧For example, given two sets of styles:
/* style 1 */
margin: 0px 10px 20px 30px;
/* style 2 */
margin-top: 0px;
margin-right: 10px;
margin-bottom: 20px;
margin-left: 30px;
The tool would look at both of these styles and recognize that they are of equivalent meaning.
Anything like that out there?
css lint won't "match" different styles, but you can upload each one and compare the results. css lint is nasty nice http://csslint.net/ you could always min and compare them: http://www.cssdrive.com/index.php/main/csscompressor/
csstidy is good for that too....
but seriously rock css lint. she rules.
actually i think css diff is what you want: http://www.gordianlabs.com/blog/?p=9
The webkit developer toolkit allows you to collapse and expand rules in to and out of their short-hand format, if one exists.
Open up Safari or Chrome, Right click and choose "Inspect Element..." on something you have a short-hand property on, and you should see the expanded property.
精彩评论