CSS specificity calculator for Sublime Text 2
- Total 4K
- Win 2K
- Mac 1K
- Linux 476
|May 17||May 16||May 15||May 14||May 13||May 12||May 11||May 10||May 9||May 8||May 7||May 6||May 5||May 4||May 3||May 2||May 1||Apr 30||Apr 29||Apr 28||Apr 27||Apr 26||Apr 25||Apr 24||Apr 23||Apr 22||Apr 21||Apr 20||Apr 19||Apr 18||Apr 17||Apr 16||Apr 15||Apr 14||Apr 13||Apr 12||Apr 11||Apr 10||Apr 9||Apr 8||Apr 7||Apr 6||Apr 5||Apr 4||Apr 3|
Use Package Control to install “sublime-csspecific”.
Alternate instructions (not recommended): Clone the repository into your Sublime Text packages folder:
git clone https://github.com/spadgos/sublime-csspecific CSSpecific
Don't forget to watch for updates!
Open a file containing CSS (this can include HTML files!), and then activate CSSpecific by hitting the hotkey (default:
Alt+Ctrl+Shift+C), or using the Command Palette.
If you have nothing selected, then all CSS selectors in the file will be evaluated. If you have one or more non-empty selections, then only the selectors which intersect with your selections will be shown.
Actual CSS specificity is not calculated as a single number. For simplicity, the real values are converted to a single number (basically, id = 100, class = 10, tag = 1), which is fine in most circumstances, but will break if you have more than 10 classes or tags referenced in a single selector. If this is the case for you, you have bigger problems to deal with first.
If you find a bug in the calculations, send me a pull request or report an issue in the tracker. Feature requests welcome, too.