I've been noticing the compressed CSS that Drupal is creating for modules and wondered how easy it would be to compress the CSS my theme files use as well. Pretty simple process in BBEdit:
1) Go to Markup > Utilities > Optimize to strip out extra spaces and wrap to one line.
2) Use Find (Command-F), check the Grep checkbox, and in the Find field, enter the following regular expression to find all occurrences of comments and leave the replace field empty:
/\* .*? \*/
3) Click Replace All.
Done. If you want reformat, select Markup > CSS > Format. Be aware that all your comments will be gone though, so you might want to create a backup for reading.
Comments
03/12/07 @ 16:17
Nice and easy way. I would never guess it. Thanks!
01/27/08 @ 19:56
Nice and easy way. I would never guess it. Thanks!
oyun hileleri
Post new comment