css minification

Adam D. Ruppe via Digitalmars-d digitalmars-d at puremagic.com
Fri Jan 16 13:20:07 PST 2015


On Friday, 16 January 2015 at 21:04:58 UTC, Andrei Alexandrescu 
wrote:
> That's why online services rok. Anyone knows of a secure css 
> minimizing service? -- Andrei

Minification in general is of dubious value, but doubly so with 
css, it barely makes a difference compared to gzip and client 
side caching.

If comments are a problem, just write a little regex thingy to 
strip them out. You could do the same to leading and trailing 
whitespace on a line, though that's really negligible too.

Or, you could use something like my css macro expand which 
transforms css in a useful way and strips out comments in the 
process.

.foo {
    .nesting-supported-with-css-expand {
     }
}

http://code.dlang.org/packages/cssexpand


More information about the Digitalmars-d mailing list