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
- (in your HTML) link to http://stripme.org/http://hobointernet.com/contentStyles.css
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.

3 comments:
Hey Danny, this sounds like a nice topic to discuss! I've blogged about it.
Definitely a £5 app idea there! I can already think of a few issues, but that's just means more to discuss.
Oh and a quick thought - you could use this approach to support different syntax for CSS (maybe to allow an easier specification of styles in a hierarchy).
Post a Comment