← Back to team overview

calibre-devs team mailing list archive

Re: CSS normalization

 

But for a bundle containing multiple HTML file with a single CSS file and not 
too many style attributes (in other words, a well designed bundle), there 
would be significant bloat, since a new stylesheet would have to be created 
with almost the same content for every HTML file.

Kovid.

On Sunday 25 January 2009 14:25:31 Marshall T. Vandegrift wrote:
> On Sun, Jan 25, 2009 at 4:57 PM, Kovid Goyal <kovid@xxxxxxxxxxxxxx> wrote:
> > I haven't tested the code yet.
>
> I found a bug (which a you may have already fixed locally) where the
> code is emitting empty 'class' attributes.  Fix pushed to 'staging'.
>
> > With flattening the CSS, the only way to do this completely robustly
> > would be to either have all class selectors or all id
> > selectors. Either case would lead to a lot of bloat in the generated
> > CSS/HTML. So I think that the current code is the best compromise.
>
> Actually, the resulting CSS+markup is smaller.
>
>    $ du -hs GBany2/
>    1.6M    GBany2/
>    $ du -hs GBflat/
>    1.2M    GBflat/
>    $ find GBany2/ -type f -name '*.css' | xargs cat | wc -lc
>    17739  336783
>    $ find GBflat/ -type f -name '*.css' | xargs cat | wc -lc
>    370    5344
>
> I'll admit this particular book is an edge case ("style" attributes on
> almost every element), but the flattened CSS is smaller in almost every
> case I've tried.
>
> -Marshall
>
> _______________________________________________
> Mailing list: https://launchpad.net/~calibre-devs
> Post to     : calibre-devs@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~calibre-devs
> More help   : https://help.launchpad.net/ListHelp
>
> !DSPAM:3,497ce6e375721492120096!

-- 
_____________________________________

Kovid Goyal  MC 452-48
California Institute of Technology
1200 E California Blvd
Pasadena, CA 91125

cell  : +01 626 390 8699
office: +01 626 395 6595 (449 Lauritsen)
email : kovid@xxxxxxxxxxxxxxxxxx
web   : http://www.kovidgoyal.net
_____________________________________




Follow ups

References