https://github.com/leopoldthecoder/postcss-hsl-color-function
PostCSS plugin to transform HSL color function to more compatible CSS.
https://github.com/leopoldthecoder/postcss-hsl-color-function
Last synced: 2 months ago
JSON representation
PostCSS plugin to transform HSL color function to more compatible CSS.
- Host: GitHub
- URL: https://github.com/leopoldthecoder/postcss-hsl-color-function
- Owner: Leopoldthecoder
- License: mit
- Created: 2016-12-24T12:29:25.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2016-12-25T03:16:58.000Z (over 9 years ago)
- Last Synced: 2025-02-08T22:17:55.273Z (over 1 year ago)
- Language: JavaScript
- Size: 32.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PostCSS HSL Color Function
[PostCSS] plugin to transform HSL color function to more compatible CSS.
Inspired and modified from [postcss-sass-color-functions].
[PostCSS]: https://github.com/postcss/postcss
[postcss-sass-color-functions]: https://github.com/adam-h/postcss-sass-color-functions
## Installation
```console
$ npm install postcss-hsl-color-function
```
## Usage
```js
postcss([require('postcss-hsl-color-function')])
```
Before:
```css
.foo {
color: hue(red, 120)
}
```
After:
```css
.foo {
color: rgb(0, 255, 0)
}
```
Checkout [test.js](index.test.js) for examples.
### Currently supported functions
- `hue(color, degree)`
- `saturation(color, percentage)`
- `lightness(color, percentage)`
and their aliases:
- `h(color, degree)`
- `s(color, percentage)`
- `l(color, percentage)`