Quote:
Originally Posted by icallaci
I hesitate to ask for this (it may be my OCD showing), but would it be possible for Modify ePub to have an option to clean up the CSS file (put classes in alphabetical order, make the formatting/indenting/spacing consistent)?
|
Not really my call. At present, I'm trying to nail down these three new routines, none of which deal with this, before handing the development reins back over to kiwidude.
That said, there are several ways to clean up CSS files, some of which have already been mentioned. One of my favorite methods is to open the book with Calibre's editor, add a new (and thus unused) class to the CSS sheet in question, and then use the Tools > Remove unused CSS rules option. (Name is from memory; I'm on my iPad right now.) Not only will that tool remove the unused classes, but it will also reformat the affected sheets to a readable standard. It doesn't do any reordering, though, as sometimes the sequence of rules within a stylesheet matters. Specifically, later rules override earlier rules. (Real example: One sheet defined * { margin: 0; } and then blockquote { margin: 1em 1.5em; } - if you reverse that sequence, blockquote loses its margins.)
Yes, if the styles are all independent, the order doesn't matter. However, in my experience, the big long sheets that are hard to wade through are most commonly template-related sheets that contain a lot of unused rules. Clear those out, and things look a lot better really fast.