Hi
When we try to tweak some EPUB, we frequently have to deal with long and confuse stylesheet, sometimes made up with aggregates built differently.
I wish this could be done within the Calibre Editor. There is an "unofficial" Calibre plugin about it (
Sort CSS.zip).
I wish I had a menu entry in the Editor which would complement the "beautify" tool and help me sort cleanly the stylesheet. This way I could also easily spot duplicates.
The sorting rule would take care of the nature of the items and then use alphabetic order (what else?)
1.
elements (with @ elements coming first like @page or @font-face). If several elements are grouped, the first one determine its alphabetic place.
If elements (like p) have several selectors, these also would be sorted out alphabetically.
2.
class selectors (beginning with a coma)
If the pertaining element is left unspecified, the class selectors shoud be placed after all the elements.
3.
ids (beginning with a #)
I think this way we could sort at least 95% of the content of any stylesheet
4. . ?