nDmitry / grunt-autoprefixer

Parse CSS and add vendor-prefixed CSS properties using the Can I Use database. Based on Autoprefixer.
MIT License
795 stars 60 forks source link

Feature req: Logfile #14

Closed uhbiv closed 10 years ago

uhbiv commented 10 years ago

Could this generate a logfile, or a comment (special comments if needed) logging the replacements it has made? I noticed that some of my files end up shorter than the original, and wanted a way to track what was pulled out. (and vice versa)

ai commented 10 years ago

BTW, Autoprefixer remove outdated prefixes, so output CSS may be shorter.

nDmitry commented 10 years ago

Thanks, it's a good idea. Now grunt-autoprefixer can create patch files like this one:

Index: tmp/diff.css
===================================================================
--- tmp/diff.css
+++ tmp/diff.css
@@ -1,3 +1,6 @@
 .test {
+  background: -webkit-linear-gradient(#000, #111);
+  background: -moz-linear-gradient(#000, #111);
+  background: -o-linear-gradient(#000, #111);
+  background: linear-gradient(#000, #111);
+}
\ No newline at end of file
-    background: linear-gradient(#000, #111);
-}

There is a new option described in README.

uhbiv commented 10 years ago

thanks @nDmitry .. this was very quick

the patch file reads a bit strange - many +/- for styles that didn't get replaced (or don't need to be logged) hope that can improve in the future. cheers!

nDmitry commented 10 years ago

@uhbiv it's a different indentation level.