View Single Post
Old 08-15-2013, 09:22 AM   #15
Man Eating Duck
Addict
Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.Man Eating Duck juggles neatly with hedgehogs.
 
Posts: 254
Karma: 69786
Join Date: May 2006
Location: Oslo, Norway
Device: Kobo Aura, Sony PRS-650
Quote:
Originally Posted by cybmole View Post
the "logic" for detecting functionally identical classes would be ridiculously complicated, because there are so many ways to say the same thing in shorthand. e,g, margin can be specified in up to 4 separate lines, : margin-top, margin-bottom... or in a single margin line with 4 parameters.

the best you could probably hope for is detecting identical blocks of definitions; even coping with the individual css lines being in a different order within different definitions would be challenging
Yes, first priority is to gather all css definitions in one place (a css file). That wouldn't necessarily require advanced css parsing. Merging css classes is more complicated and will probably require a parser. Unfortunately it doesn't seem that Qt provides an API for the webkit css parser, that would've been great

Quote:
Originally Posted by cybmole View Post
there are "master sets" of "in-house" CSS out there, with an definition for everything you could possibly need - inspect any book that uses the adobe approach - but I much prefer to see only what is actually needed for the given book, within the style sheet, not a load of excess stuff.
If extraneous classes bother you: Sigil already has a "Delete unused stylesheet classes" function, have you tried it?
Man Eating Duck is offline   Reply With Quote