{"name":"postcss-color-function","version":"4.0.1","description":"PostCSS plugin to transform W3C CSS color function to more compatible CSS.","keywords":["css","postcss","postcss-plugin","color","colour","function"],"author":{"name":"Maxime Thirouin"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/postcss/postcss-color-function.git"},"files":["index.js"],"dependencies":{"css-color-function":"~1.3.3","postcss":"^6.0.1","postcss-message-helpers":"^2.0.0","postcss-value-parser":"^3.3.0"},"devDependencies":{"eslint":"^3.19.0","npmpub":"^3.1.0","tape":"^3.0.0"},"scripts":{"lint":"eslint *.js index.js ./test/","test":"npm run lint && tape test","release":"npmpub"},"gitHead":"ca0891f86554877eb1263716c881c387e5fb691d","bugs":{"url":"https://github.com/postcss/postcss-color-function/issues"},"homepage":"https://github.com/postcss/postcss-color-function#readme","_id":"postcss-color-function@4.0.1","_shasum":"402b3f2cebc3f6947e618fb6be3654fbecef6444","_from":".","_npmVersion":"3.10.6","_nodeVersion":"6.3.1","_npmUser":{"name":"semigradsky","email":"semigradskyd@gmail.com"},"dist":{"shasum":"402b3f2cebc3f6947e618fb6be3654fbecef6444","tarball":"http://registry-npm.ywwl.com/postcss-color-function/download/postcss-color-function-4.0.1.tgz","integrity":"sha512-vt0hQkB1X3hzOxp/spcEQVgyCGPpMB/7WiF49breEyTAjH+VUjbIDLXbiEtRhRTYO5KWYvHgdoNvyrPwayBxfw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCbcSq6zSPjO53d5sun+bvrw9oGwYoktlldhEfmteqamQIgNWlCK85JghD9f6/5dADag5sxy3hI5wc7Sxz2U6IyJfI="}],"size":3675,"noattachment":false,"key":"/postcss-color-function/-/postcss-color-function-4.0.1.tgz"},"maintainers":[{"name":"jonathantneal","email":"jonathantneal@hotmail.com"},{"name":"moox","email":"m@moox.io"},{"name":"semigradsky","email":"semigradskyd@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/postcss-color-function-4.0.1.tgz_1509703808230_0.502085832413286"},"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":1509703809112,"_cnpm_publish_time":1509703809112,"dist-tags":{"latest":"4.1.0"}}