View Single Post
Old 09-06-2016, 08:54 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 45,414
Karma: 27757236
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I dont see how you can sort CSS rules at all, in the general case. For example,

.class2 { color: red}
.class1 { color: green}

If you sort that to

.class1 { color: green}
.class2 { color: red}


You will have changed the color of any element that has both those selectors apply to it. Before the sort, it would be green, after the sort it would be red.

This is because the specificity of a selector depends on its position in the stylesheet with respect to other selectors.
kovidgoyal is offline   Reply With Quote