Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dustinspecker/shorten-css-hex
Shorten CSS hex codes
https://github.com/dustinspecker/shorten-css-hex
Last synced: 2 days 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 (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-05-31T21:40:33.000Z (over 7 years ago)
- Last Synced: 2024-10-02T22:04:59.669Z (about 1 month 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
[![NPM version](https://badge.fury.io/js/shorten-css-hex.svg)](https://badge.fury.io/js/shorten-css-hex) [![Build Status](https://travis-ci.org/dustinspecker/shorten-css-hex.svg)](https://travis-ci.org/dustinspecker/shorten-css-hex) [![Coverage Status](https://img.shields.io/coveralls/dustinspecker/shorten-css-hex.svg)](https://coveralls.io/r/dustinspecker/shorten-css-hex?branch=master)[![Code Climate](https://codeclimate.com/github/dustinspecker/shorten-css-hex/badges/gpa.svg)](https://codeclimate.com/github/dustinspecker/shorten-css-hex) [![Dependencies](https://david-dm.org/dustinspecker/shorten-css-hex.svg)](https://david-dm.org/dustinspecker/shorten-css-hex/#info=dependencies&view=table) [![DevDependencies](https://david-dm.org/dustinspecker/shorten-css-hex/dev-status.svg)](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)