{"name":"pleeease-filters","version":"0.1.3","description":"Convert CSS shorthand filters to SVG ones","author":{"name":"Vincent De Oliveira"},"main":"./index","keywords":["postprocessor","css","postcss","pleeease","filters"],"scripts":{"test":"jasmine-node spec"},"dependencies":{"postcss":"^1.0.0","onecolor":"~2.4.0"},"devDependencies":{"jasmine-node":"~1.14.3"},"_id":"pleeease-filters@0.1.3","dist":{"shasum":"322a5b209f2356a6d281816293737c432f8678dd","tarball":"http://registry-npm.ywwl.com/pleeease-filters/download/pleeease-filters-0.1.3.tgz","integrity":"sha512-AySX4M0lqh8IcsD+92QLlszub8JZjvMX/rqovWE/P/ak/lDd9VbHrz8dbNLDAfhLkvdYXDf9sxjVeOWy5cXBjQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0keQPW5UiJVTplMdeqwrR9O9tlE4GHS+cziObiMoQJQIgB4Pwuhixe2kKutCYVEX+kH9kc6yPKD/OJrAuvuebhAI="}],"size":4349,"noattachment":false,"key":"/pleeease-filters/-/pleeease-filters-0.1.3.tgz"},"_from":".","_npmVersion":"1.3.11","_npmUser":{"name":"iamvdo","email":"vincent@iamvdo.me"},"maintainers":[{"name":"iamvdo","email":"vincent@iamvdo.me"}],"directories":{},"readme":"Pleeease: filters\r\n=================\r\n\r\nConvert CSS shorthand filters to SVG equivalent.\r\n\r\nUsed by [Pleeease](https://github.com/iamvdo/pleeease), a CSS post-processor.\r\n\r\nTry it by yourself in the [Pleeease playground](http://pleeease.io/playground.html?div%20%7B%0A%20%20filter:%20blur(4px)%0A%7D)\r\n\r\n##Example\r\n\r\nYou write `foo.css`:\r\n\r\n```css\r\n.blur {\r\n\tfilter: blur(4px);\r\n}\r\n```\r\n\r\nYou get `bar.css`:\r\n\r\n```css\r\n.blur {\r\n\tfilter: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\"><filter id=\"filter\"><feGaussianBlur stdDeviation=\"4\" /></filter></svg>#filter');\r\n\tfilter: blur(4px);\r\n}\r\n```\r\n\r\n##Filters\r\n\r\nIt converts all 10 CSS shorthand filters:\r\n\r\n* grayscale\r\n* sepia\r\n* saturate\r\n* hue-rotate\r\n* invert\r\n* opacity\r\n* brightness\r\n* contrast\r\n* blur\r\n* drop-shadow\r\n\r\nLearn [more about CSS filters](https://developer.mozilla.org/en-US/docs/Web/CSS/filter)\r\n\r\n##Prefixes\r\n\r\nThis tool doesn't add prefixes. If you want them, you should use [Autoprefixer](https://github.com/ai/autoprefixer). This is what [Pleeease](https://github.com/iamvdo/pleeease) does:\r\n\r\n```css\r\n.blur {\r\n\tfilter: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\"><filter id=\"filter\"><feGaussianBlur stdDeviation=\"4\" /></filter></svg>#filter');\r\n\t-webkit-filter: blur(4px);\r\n\t        filter: blur(4px);\r\n}\r\n```\r\n\r\n##Usage\r\n\r\n\t$ npm install pleeease-filters\r\n\r\n```javascript\r\nvar filters = require('pleeease-filters'),\r\n\tfs      = require('fs');\r\n\r\nvar css = fs.readFileSync('app.css', 'utf8');\r\n\r\n// define options here\r\nvar options = {};\r\n\r\nvar fixed = filters.process(css, options);\r\n\r\nfs.writeFile('app.min.css', fixed, function (err) {\r\n  if (err) {\r\n    throw err;\r\n  }\r\n  console.log('File saved!');\r\n});\r\n```\r\n##Options\r\n\r\nYou can also add IE filters with an option:\r\n\r\n```javascript\r\n// set options\r\nvar options = {\r\n\toldIE: true\r\n}\r\n```\r\n\r\nUsing the first example, you'll get:\r\n\r\n```css\r\n.blur {\r\n\tfilter: url('data:image/svg+xml;utf8,<svg xmlns=\"http://www.w3.org/2000/svg\"><filter id=\"filter\"><feGaussianBlur stdDeviation=\"4\" /></filter></svg>#filter');\r\n\tfilter: blur(4px);\r\n\tfilter: progid:DXImageTransform.Microsoft.Blur(pixelradius=4);\r\n}\r\n```\r\n\r\n##Note\r\n\r\n**Be careful**, not all browsers support CSS or SVG filters on HTML content:\r\n\r\n* latest WebKit browsers support CSS shorthand\r\n* Firefox support SVG filters (and CSS shorthand since FF35)\r\n* IE9- support IE filters (limited and slightly degraded)\r\n\r\n**It means that IE10+, Opera Mini and Android browsers have no support at all on HTML, only in SVG.**\r\n\r\nMoreover, IE filters shouldn't be used.\r\n\r\nSee [caniuse](http://caniuse.com/#feat=svg-filters) for more info.\r\n\r\n##Licence\r\n\r\nMIT © 2014 [Vincent De Oliveira &middot; iamvdo](https://github.com/iamvdo)\r\n\r\nThis module is an adaptation of [CSS-Filters-Polyfill](https://github.com/Schepp/CSS-Filters-Polyfill). Copyright (c) 2012 - 2013 Christian Schepp Schaefer\r\n","publish_time":1404741110763,"_cnpm_publish_time":1404741110763,"dist-tags":{"latest":"4.0.0"}}