{"name":"postcss-color-function","version":"1.1.0","description":"PostCSS plugin to transform W3C CSS color function to more compatible CSS.","keywords":["css","postcss","postcss-plugins","color","colour","function"],"author":{"name":"Maxime Thirouin"},"license":"MIT","repository":{"type":"git","url":"https://github.com/postcss/postcss-color-function.git"},"files":["CHANGELOG.md","LICENSE","index.js"],"dependencies":{"balanced-match":"^0.1.0","css-color-function":"^1.1.1","postcss-message-helpers":"^1.1.0"},"devDependencies":{"jscs":"^1.6.2","jshint":"^2.5.6","postcss":"^3.0.0","tape":"^3.0.0"},"scripts":{"lint":"jscs *.js **/*.js && jshint . --exclude-path .gitignore","test":"npm run lint && tape test"},"gitHead":"c9994cfdcafe0b82310bd5bcb35c71645640a431","bugs":{"url":"https://github.com/postcss/postcss-color-function/issues"},"homepage":"https://github.com/postcss/postcss-color-function","_id":"postcss-color-function@1.1.0","_shasum":"faf713fb7538194600b200403edf17e9bd55ebca","_from":".","_npmVersion":"2.1.6","_nodeVersion":"0.10.33","_npmUser":{"name":"moox","email":"m@moox.io"},"maintainers":[{"name":"moox","email":"m@moox.io"}],"dist":{"shasum":"faf713fb7538194600b200403edf17e9bd55ebca","tarball":"http://registry-npm.ywwl.com/postcss-color-function/download/postcss-color-function-1.1.0.tgz","integrity":"sha512-pzzy4FjMlp3jjlhiNAOuBT2sD14dXOZc9/MJjFfXGCG/UEDhch0sa9r2QkoXlMH2eW7Dx99Q/7mBhbUWyhvYiA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlwpb97pmBDPfl77L19SrBIojBsOcDBuYkCvcPzvT1EgIhAIqIFeedsTOJf9IPvX3RqQZYiVPoRWYKltGGLQ0itX4u"}],"size":2309,"noattachment":false,"key":"/postcss-color-function/-/postcss-color-function-1.1.0.tgz"},"directories":{},"readme":"# postcss-color-function [![Build Status](https://travis-ci.org/postcss/postcss-color-function.svg)](https://travis-ci.org/postcss/postcss-color-function)\n\n[PostCSS](https://github.com/postcss/postcss) plugin to transform CSS color function from editor draft of 'Color Module Level 4' specification to more compatible CSS.\n\n## Deprecated\n\n**⚠️ `color()` was changed to `color-mod()`. See [postcss-color-mod-function](https://github.com/jonathantneal/postcss-color-mod-function).**\n\n> There is a\n  [`color-mod`](https://github.com/jonathantneal/postcss-color-mod-function)\n  implementation.\n\n**⚠️ `color-mod()` has been removed from [Color Module Level 4 specification](https://www.w3.org/TR/css-color-4/#changes-from-20160705).**\n\n## Installation\n\n```console\nnpm install postcss-color-function\n```\n\n## Usage\n\n```js\n// dependencies\nvar fs = require(\"fs\")\nvar postcss = require(\"postcss\")\nvar colorFunction = require(\"postcss-color-function\")\n\n// css to be processed\nvar css = fs.readFileSync(\"input.css\", \"utf8\")\n\n// process css\n// set preserveCustomProps to `false` by default `true`\n//for delete declarations with custom properties\nvar output = postcss()\n  .use(colorFunction({preserveCustomProps: true}))\n  .process(css)\n  .css\n```\n\nUsing this `input.css`:\n\n```css\nbody {\n  background: color(red a(90%))\n}\n\n```\n\nyou will get:\n\n```css\nbody {\n  background: rgba(255, 0, 0, 0.9)\n}\n```\n\nCheckout [tests](test) for examples.\n\n## Interface (according to CSS specs)\n\n```\ncolor( [ <color> | <hue> ] <color-adjuster>* )\n```\n\n### List of `color-adjuster`\n\n- `[red( | green( | blue( | alpha( | a(] ['+' | '-']? [<number> | <percentage>] )`\n- `[red( | green( | blue( | alpha( | a(] '*' <percentage> )`\n- ~~`rgb( ['+' | '-'] [<number> | <percentage>]{3} )`~~ @todo\n- ~~`rgb( ['+' | '-'] <hash-token> )`~~ @todo\n- ~~`rgb( '*' <percentage> ) |`~~ @todo\n- `[hue( | h(] ['+' | '-' | '*']? <angle> )`\n- `[saturation( | s(] ['+' | '-' | '*']? <percentage> )`\n- `[lightness( | l(] ['+' | '-' | '*']? <percentage> )`\n- `[whiteness( | w(] ['+' | '-' | '*']? <percentage> )`\n- `[blackness( | b(] ['+' | '-' | '*']? <percentage> )`\n- `tint( <percentage> )`\n- `shade( <percentage> )`\n- `blend( <color> <percentage> [rgb | hsl | hwb]? )`\n- ~~`blenda( <color> <percentage> [rgb | hsl | hwb]? )`~~ @todo\n- `contrast( <percentage>? )`\n\nNotes:\n\n- some adjusts have shortcuts,\n- can be used on every value on any property,\n- some values can use add/subtract/scale modifiers or a direct value.\n\n### Examples\n\n```css\nwhatever {\n  color: color(red a(10%));\n\n  background-color: color(red lightness(50%)); /* == color(red l(50%)); */\n\n  border-color: color(hsla(125, 50%, 50%, .4) saturation(+ 10%) w(- 20%));\n}\n```\n\n## FAQ\n\n### Can you support `currentcolor` so we can do `color(currentcolor adjuster())`?\n\nNo we cannot do that. `currentcolor` depends on the cascade (so the DOM) and we can't handle that in a simple preprocessing step. You need to handle that with polyfills.\n\n### Can we use CSS custom properties so we can do `color(var(--mainColor) adjuster())`?\n\nBy using [postcss-custom-properties](https://github.com/postcss/postcss-custom-properties) before this plugin, you can do that (sort of).\nYou have some examples in [cssnext playground](http://cssnext.io/playground/).\n\n## Notes for former Sass users\n\n`lighten` and `darken` are Sass specific methods and not supported by native CSS specs. The same functionality can be achieved with the [tint and shade adjusters](https://drafts.csswg.org/css-color/#tint-shade-adjusters):\n\n```css\n$lighten(red, 20%)\n/*  is equivalent to */\ncolor(red tint(20%))\n\n$darken(red, 20%)\n/*  is equivalent to */\ncolor(red shade(20%))\n```\n\n---\n\n## [Changelog](CHANGELOG.md)\n\n## [License](LICENSE)\n","publish_time":1416901934182,"_cnpm_publish_time":1416901934182,"dist-tags":{"latest":"4.1.0"}}