Ouispecify

A simple CSS specificity calculator

View the Project on GitHub carlsednaoui/ouispecify

A Simple CSS Specificity Calculator

Call specify() with your css selectors, you'll receive an object with both the specificity number & the details.

Example

specify('h1#title');                
// returns {specificity: [1,0,1],
            details: [['#title'],[],['h1']]};

Live example

Here is a live example.

Project page

Here is the official project page.

Resources

License

MIT