ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

sublime-csspecific

by spadgos ST2

CSS specificity calculator for Sublime Text 2

Details

Installs

  • Total 4K
  • Win 2K
  • Mac 1K
  • Linux 476
Dec 30 Dec 29 Dec 28 Dec 27 Dec 26 Dec 25 Dec 24 Dec 23 Dec 22 Dec 21 Dec 20 Dec 19 Dec 18 Dec 17 Dec 16 Dec 15 Dec 14 Dec 13 Dec 12 Dec 11 Dec 10 Dec 9 Dec 8 Dec 7 Dec 6 Dec 5 Dec 4 Dec 3 Dec 2 Dec 1 Nov 30 Nov 29 Nov 28 Nov 27 Nov 26 Nov 25 Nov 24 Nov 23 Nov 22 Nov 21 Nov 20 Nov 19 Nov 18 Nov 17 Nov 16
Windows 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

CSSpecific is a Sublime Text plugin which will calculate and display the CSS Specificity value of your selectors.

Installation

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!

Usage

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.

Notes

  • 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.