Skip to content
master
Switch branches/tags
Code

Latest commit

 

Git stats

Files

Permalink
Failed to load latest commit information.
Type
Name
Latest commit message
Commit time
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Sort Specificity

Sort css selector for specificity

NPM npm version Build Status

Instalation

npm install sort-specificity

Usage

var sortSpecificity = require('sort-specificity')
var input = [
  "a .d b#foo",
  "b",
  "a .d b.d",
  "a b",
  "a .d b",
]
var result = sortSpecificity(input)

result is

[
  "a .d b#foo",
  "a .d b.d",
  "a .d b",
  "a b",
  "b"
]

Input raw css

You can input raw css.

var css = fs.readFileSync("./fixtures/sample.css", "utf-8")
var result = sortSpecificity(css) // parsed css selctor

About

Sort css selector for specificity

Resources

Packages

No packages published