If you use a workflow automation tool or task runner (e.g. Gulp or Grunt) you may be minifying your stylesheet. The following code snippet allows you to serve the minified stylesheet by default, but load the un-minified version for debugging complete with a cache-busting query parameter when debugging.
Quick tip: You can actually reformat the minified stylesheet in Chrome’s Developer Tools. That’s a quick way to debug if you need to. The animation below is from this excellent article on The WP Crowd which I encourage you to read if you want to know why you should bother serving minified files:
Leave a Reply