# css-unit-sort

> Sort css values no matter the unit

Latest version **4.0.1** (published 2021-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install css-unit-sort
pnpm add css-unit-sort
yarn add css-unit-sort
bun add css-unit-sort
```

## 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 | 4.0.1 |
| Published | 2021-02-24 |
| First published | 2016-10-27 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2815 |
| Author | John Otander |
| Maintainers | johno |
| Keywords | sort, css, unit, px, rem, em |

## Links

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

## 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

- 4.0.1 (latest) — 2021-02-24
- 4.0.0 — 2020-12-08
- 3.5.0 — 2020-11-03
- 3.3.1 — 2019-07-26
- 3.3.0 — 2019-03-23
- 1.1.1 — 2017-04-25
- 1.1.0 — 2016-11-01
- 1.0.1 — 2016-10-27
- 1.0.0 — 2016-10-27

## README

# css-unit-sort

Sort css values no matter the unit.
Originally [written](https://github.com/cssstats/cssstats/blob/16fe37c96623fd3cdb24bd302ef6f6e93826af0f/controllers/stats.js#L98) by [@jxnblk](https://twitter.com/jxnblk).

## Installation

```bash
npm i -S css-unit-sort
```

## Usage

```javascript
const cssUnitSort = require('css-unit-sort')

cssUnitSort(['2rem', 'inherit', 'small', '12px', '20px', '60px', '1.5em']) // => ['60px', '2rem', '1.5em', '20px', 'inherit', 'small', '12px']
```

## License

MIT

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

Crafted with <3 by John Otander ([@4lpine](https://twitter.com/4lpine)).

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