After using a CSS optimizer a couple of days ago, I realized that if you write your CSS properly, you should never need a CSS optimizer. Here's why: when a CSS optimizer runs, it groups all the selectors together that share common styles and rules. For example, if you have on 50 different selectors, it's going to group them all together. Which means in most cases, it will repeat that pattern for all the different styles that you've applied throughout the stylesheet. So if you've got Here's what it looked like after I optimized: As you can see, that's a lot of CSS for setting two values, CSS optimization can be good, but only if you write terrible CSS or repeat the same styles over and over again throughout your stylesheet. Now that's not to say you shouldn't minify and/or compress your CSS. That's something that doesn't change the order and values of the CSS, but makes it more compact when delivered to the user's browser. |
CSS Optimization
Posted by Webber at 1:49 AMThis entry was posted on 1:49 AM . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment