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