Quote:
Originally Posted by kovidgoyal
If you want to make it robust, you have to do a multisort, sorting primarily on selector specificity and secondarily on selector name. You can use the cssselect module to easily calculate selector specificities.
|
Thanks, I'll have a look at that. The current sort is purely selector. And of course that doesn't work. Not all the style types have a selector. When I tested with the calibre portable, I hit an error with the "@namespace" that is in the stylesheet for the calibre user guide.