# sort-specificity

> Sort CSS specificity

Latest version **1.0.1** (published 2016-05-13) · ISC license · 0 weekly downloads

## Install

```sh
npm install sort-specificity
pnpm add sort-specificity
yarn add sort-specificity
bun add sort-specificity
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2016-05-13 |
| First published | 2014-03-29 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 3 |
| Author | inuscript |
| Maintainers | suisho, inuscript |
| Keywords | css, specificity, sort |

## Links

- npm: https://www.npmjs.com/package/sort-specificity
- Repository: https://github.com/inuscript/sort-specificity
- Homepage: https://github.com/inuscript/sort-specificity#readme
- Issues: https://github.com/inuscript/sort-specificity/issues
- npm.io page: https://npm.io/package/sort-specificity

## Dependencies (4)

- [stable](https://npm.io/package/stable.md) 0.1.5
- [flatten](https://npm.io/package/flatten.md) ^1.0.2
- [postcss](https://npm.io/package/postcss.md) ^5.0.21
- [specificity](https://npm.io/package/specificity.md) ^0.1.5

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 1.0.1 (latest) — 2016-05-13
- 1.0.0 — 2016-05-12
- 0.3.0 — 2016-05-12
- 0.2.0 — 2015-01-21
- 0.1.1 — 2014-04-07
- 0.1.0 — 2014-03-29

## README

# Sort Specificity

Sort css selector for specificity


[![NPM](https://nodei.co/npm/sort-specificity.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/sort-specificity/)
[![npm version](https://badge.fury.io/js/sort-specificity.svg)](https://badge.fury.io/js/sort-specificity)
[![Build Status](https://travis-ci.org/inuscript/sort-specificity.svg?branch=master)](https://travis-ci.org/inuscript/sort-specificity)



## Instalation

```sh
npm install sort-specificity
```

## Usage

```js
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

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

### Input raw css
You can input raw css.

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

---
_Source: https://npm.io/package/sort-specificity · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
