pleeease-filters
Advanced tools
Comparing version 0.1.3 to 0.1.4
10
index.js
@@ -532,3 +532,3 @@ var postcss = require('postcss'); | ||
// Drop Shadow | ||
fmatch = value.match(/(drop\-shadow)\((\s*[0-9\.]+)(px|em|rem| )\s*([0-9\.]+)(px|em|rem| )\s*([0-9\.]+)(px|em|rem| )\s*([a-z0-9#%,.\s]+)\s*\)/i); | ||
fmatch = value.match(/(drop\-shadow)\((\s*[0-9\.]+)(px|em|rem| )\s*([0-9\.]+)(px|em|rem| )\s*([0-9\.]+)(px|em|rem| )\s*([a-z0-9\#\%\,\.\s\(\)]*)(?=\s*\))/i); | ||
if (fmatch !== null) { | ||
@@ -568,4 +568,8 @@ var offsetX = parseFloat(fmatch[2], 10), | ||
for (var key in values) { | ||
var value = values[key] + ')'; | ||
for (var i = 0; i < values.length; i++) { | ||
var value = values[i]; | ||
// when splitting values, re-add closing parenthesis | ||
if (i != values.length - 1) { | ||
value += ')'; | ||
} | ||
var currentProperties = _this.convert(value); | ||
@@ -572,0 +576,0 @@ for (var j in currentProperties){ |
{ | ||
"name": "pleeease-filters", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "Convert CSS shorthand filters to SVG ones", | ||
@@ -20,3 +20,3 @@ "author": { | ||
"dependencies": { | ||
"postcss": "^1.0.0", | ||
"postcss": "^3.0.0", | ||
"onecolor": "~2.4.0" | ||
@@ -23,0 +23,0 @@ }, |
@@ -8,2 +8,4 @@ Pleeease: filters | ||
Try it by yourself in the [Pleeease playground](http://pleeease.io/playground.html?div%20%7B%0A%20%20filter:%20blur(4px)%0A%7D) | ||
##Example | ||
@@ -45,2 +47,14 @@ | ||
##Prefixes | ||
This 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: | ||
```css | ||
.blur { | ||
filter: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg"><filter id="filter"><feGaussianBlur stdDeviation="4" /></filter></svg>#filter'); | ||
-webkit-filter: blur(4px); | ||
filter: blur(4px); | ||
} | ||
``` | ||
##Usage | ||
@@ -91,4 +105,14 @@ | ||
**Be careful**, not all browsers support CSS or SVG filters. For your information, latest WebKit browsers support CSS shorthand, Firefox support SVG filters and IE9- support IE filters (limited and slightly degraded). **It means that IE10+, Opera Mini and Android browsers have no support at all.** Moreover, IE filters shouldn't be used. | ||
**Be careful**, not all browsers support CSS or SVG filters on HTML content: | ||
* latest WebKit browsers support CSS shorthand | ||
* Firefox support SVG filters (and CSS shorthand since FF35) | ||
* IE9- support IE filters (limited and slightly degraded) | ||
**It means that IE10+, Opera Mini and Android browsers have no support at all on HTML, only in SVG.** | ||
Moreover, IE filters shouldn't be used. | ||
See [caniuse](http://caniuse.com/#feat=svg-filters) for more info. | ||
##Licence | ||
@@ -95,0 +119,0 @@ |
18686
530
120
+ Addedjs-base64@2.1.9(transitive)
+ Addedpostcss@3.0.7(transitive)
- Removedbase64-js@0.0.8(transitive)
- Removedpostcss@1.0.0(transitive)
Updatedpostcss@^3.0.0