Idea: CSS Comment Stripper
Update: StripMe.org is live. Yandleblog post about it.
I recently read a post on a local mailing list where someone emphatically said "style sheets should not have comments in them. Ever." (or something along those lines). But of course comments are very hand things to have, especially I someone else is eventually going to have to ork with your files.
This got me thinking that maybe someone should build a server-side application that strips comments comments from your CSS.
That's when I hit upon this idea (maybe an idea for a £5 App).
The "Stripper"
Initially, I tought it could work a bit like tinyurl:
- Go to http://stripme.org [nothing there yet]
- Enter the address of your CSS file (e.g. hobointernet.com/contentStyles.css) in a form
- The site gives you a URL for a version of the CSS file sans-comments, e.g. http://stripme.org/234cvfrv.css
- (in your HTML) link to this URL instead of linking directly to your CSS
Then, having talked the idea through with Ben, I realized that there's a simpler, more RESTful way of doing it…
- (in your HTML) link to http://stripme.org/http://hobointernet.com/contentStyles.css
…the service returns your CSS file without comments.
This method has the advantages that the originating file in not hidden (so people can get to your comments easily), it's really easy to remember and there's no forms.
Got Several style sheets you want to get concatenated into one? No problem, just use a URL like:
http://stripme.org/http://hobointernet.com/contentStyles.css+contentStyles.css
I might talk about this idea after Dan Glegg's talk at the next £5 -Apps meet.