Skip to main content

All Questions

8 votes
1 answer
425 views

Order by CSS Specificity

My main goal is to try to reorder a CSS style block based on specificity. I previously had helped from SO and I managed to produce this function. See gist. Here is an example: function specificity($...
Abs's user avatar
  • 58k
6 votes
2 answers
345 views

Order CSS based on Selector Specificity

I have parsed a given CSS file/string into a JSON object like so: { "#header": { "color": "#000000" }, "#header h1": { "color": "#000" }, "h1": { "color": "...
Abs's user avatar
  • 58k