Cleaning up CSS automatically may be considerably difficult if the stylesheet includes "advanced" selectors or rules like children, adjacent siblings, precedende, multiple classes, etc.
But there could be an option like the "flatten CSS" used by calibre, where every defined selector or combination is converted into a class (I believe that's what it does), then it's easier to "simplify", but you lose much of the charm of CSS. Nevertheless, the coding of most books needing a cleanup has no charm at all, so there's not much to lose.
|