Script identifying CSS shorthand possibilities
For my own convenience I created this script to identify css files where colors like #aaaaaa can be rewritten in the short form #aaa
(saves bandwith, but can also make it easier to identify similar colors)
grep -nE '#([0-9a-f])\1([0-9a-f])\2([0-9a-f])\3' **/*.css
output from a random project:
css/actions.css:19: color: #000000;
css/actions.css:38: color: #000000 !important;
css/actions.css:53: color: #ffffff !important;
css/admin.css:90: color: #cccccc;
css/admin.css:94: color: #aaaaaa !important;
October 22nd, 2009 at 17:29 (GMT-1)
great tip, this sure does save a lot loading time, another great tip is grouping the h1 tags eg. h1,h2,h3 { font-size:1.4em; }
October 27th, 2009 at 13:38 (GMT-1)
Does truncating from 6 to 3 characters really save that much bandwidth?