Unminify Minified CSS

Say what?

Well, I was working with Google’s prettyprint library which is really nice for outputting code in a nice and ‘print friendly’ way. It even allows you to skin the way it looks and I used a really nice sunburst theme.

One of the things I wanted that it didn’t offer by default was code line number on every line. By default it shows you every 5th line. You can start the line numbering to begin at any number but not every line shows.

I looked online and found how to do this. The instructions were simple. Just comment out this line of code:

li.L8 { list-style-type: none }

So I jumped into prettyprint.css and saw that it was minified and didn’t see an unminified version of the css file. I downloaded the src code and it didn’t have it either. It then occurred to me… if I can use tools to minify CSS, can I use a tool to un-minify CSS? The answer is yes. Here it is.

I un-minified my CSS and commented out the code like I was told. Nothing happened. Why? Because I wasn’t using prettify.css. I was using sunburst.min.css. So I un-minified that, made the appropriate changes by commenting out the line and it worked. I now have lines on all my prettyprinted pages. A small victory for mankind. A small victory for me.