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
Oct 31 Oct 30 Oct 29 Oct 28 Oct 27 Oct 26 Oct 25 Oct 24 Oct 23 Oct 22 Oct 21 Oct 20 Oct 19 Oct 18 Oct 17 Oct 16 Oct 15 Oct 14 Oct 13 Oct 12 Oct 11 Oct 10 Oct 9 Oct 8 Oct 7 Oct 6 Oct 5 Oct 4 Oct 3 Oct 2 Oct 1 Sep 30 Sep 29 Sep 28 Sep 27 Sep 26 Sep 25 Sep 24 Sep 23 Sep 22 Sep 21 Sep 20 Sep 19 Sep 18 Sep 17
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.