https://github.com/dustinspecker/shorten-css-hex
Shorten CSS hex codes
https://github.com/dustinspecker/shorten-css-hex
Last synced: 6 months ago
JSON representation
Shorten CSS hex codes
- Host: GitHub
- URL: https://github.com/dustinspecker/shorten-css-hex
- Owner: dustinspecker
- License: mit
- Created: 2015-09-03T23:21:39.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2017-05-31T21:40:33.000Z (about 8 years ago)
- Last Synced: 2025-01-06T17:38:00.185Z (6 months ago)
- Language: JavaScript
- Size: 23.4 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# shorten-css-hex
[](https://badge.fury.io/js/shorten-css-hex) [](https://travis-ci.org/dustinspecker/shorten-css-hex) [](https://coveralls.io/r/dustinspecker/shorten-css-hex?branch=master)[](https://codeclimate.com/github/dustinspecker/shorten-css-hex) [](https://david-dm.org/dustinspecker/shorten-css-hex/#info=dependencies&view=table) [](https://david-dm.org/dustinspecker/shorten-css-hex/#info=devDependencies&view=table)
> Shorten CSS hex codes
## Install
```
npm install --save shorten-css-hex
```## Usage
### ES2015
```javascript
import shortenCssHex from 'shorten-css-hex';shortenCssHex('#000000');
// => '#000'shortenCssHex('#AaBBcC');
// => '#abc'shortencsshex('#112233ff');
// => '#123f'shortencsshex('#123456');
// => '#123456'shortencsshex('#123456ff');
// => '#123456ff'
```### ES5
```javascript
var shortenCssHex = require('shorten-css-hex');shortenCssHex('#000000');
// => '#000'shortenCssHex('#AaBBcC');
// => '#abc'shortencsshex('#112233ff');
// => '#123f'shortencsshex('#123456');
// => '#123456'shortencsshex('#123456ff');
// => '#123456ff'
```## LICENSE
MIT © [Dustin Specker](https://github.com/dustinspecker)