# postcss-sass-color-functions

> PostCSS plugin to implement SASS color functions

Latest version **1.1.0** (published 2016-05-17) · 0 weekly downloads

## Install

```sh
npm install postcss-sass-color-functions
pnpm add postcss-sass-color-functions
yarn add postcss-sass-color-functions
bun add postcss-sass-color-functions
```

## 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.1.0 |
| Published | 2016-05-17 |
| First published | 2016-05-17 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Adam Heath |
| Maintainers | baiyaaaaa |
| Keywords | css, postcss, postcss-plugin, sass, color, colour, function |

## Links

- npm: https://www.npmjs.com/package/postcss-sass-color-functions
- Repository: https://github.com/adam-h/postcss-sass-color-functions
- Homepage: https://github.com/adam-h/postcss-sass-color-functions#readme
- Issues: https://github.com/adam-h/postcss-sass-color-functions/issues
- npm.io page: https://npm.io/package/postcss-sass-color-functions

## Dependencies (4)

- [color](https://npm.io/package/color.md) ^0.11.1
- [postcss](https://npm.io/package/postcss.md) ^5.0.4
- [balanced-match](https://npm.io/package/balanced-match.md) ^0.1.0
- [postcss-message-helpers](https://npm.io/package/postcss-message-helpers.md) ^2.0.0

## Alternatives

- [postcss-color-hex-alpha](https://npm.io/package/postcss-color-hex-alpha.md) — 6.4M weekly downloads
- [randomcolor](https://npm.io/package/randomcolor.md) — 348.0K weekly downloads
- [bows](https://npm.io/package/bows.md) — 1.3K weekly downloads
- [ep_prefer_color_scheme](https://npm.io/package/ep_prefer_color_scheme.md) — 260 weekly downloads
- [coc-yank](https://npm.io/package/coc-yank.md) — 61 weekly downloads

## Recent versions

- 1.1.0 (latest) — 2016-05-17

## README

[PostCSS](https://github.com/postcss/postcss) plugin to transform SASS/compass color functions to more compatible CSS.

Inspired, and modified from, [postcss-color-function](https://github.com/postcss/postcss-color-function).

## Installation

```console
$ npm install git://github.com/adam-h/postcss-sass-color-functions.git
```

## Usage

```js
// dependencies
var fs = require("fs")
var postcss = require("postcss")
var sassColorFunctions = require("postcss-sass-color-functions")

// css to be processed
var css = fs.readFileSync("input.css", "utf8")

// process css
var output = postcss()
  .use(sassColorFunctions())
  .process(css)
  .css
```

Using this `input.css`:

```css
body {
  background-color: mix(#255073, #3c749e, 25%);
}

```

you will get:

```css
body {
  background-color: rgb(54, 107, 147);
}
```

Checkout [tests.js](tests.js) for examples.


### Currently Supported functions

 - `mix(one, two, weight)`
 - `rgba(color, alpha)`
 - `darken(color, amount)`
 - `lighten(color, amount)`
 - `tint(color, amount)`
 - `shade(color, amount)`

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