pleeease-filters
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,1 +1,5 @@ | ||
# 1.0.1 - 2015-05-25 | ||
- Avoid drop-shadow spread to throw an error, and keep as-is | ||
# 1.0.0 - 2015-01-27 | ||
@@ -2,0 +6,0 @@ |
14
index.js
@@ -371,3 +371,3 @@ var postcss = require('postcss'); | ||
// Drop Shadow | ||
dropShadow: function (offsetX, unitX, offsetY, unitY, radius, unitRadius, color) { | ||
dropShadow: function (offsetX, unitX, offsetY, unitY, radius, unitRadius, spread, unitSpread, color) { | ||
offsetX = Math.round(offsetX) || 0; | ||
@@ -380,3 +380,3 @@ offsetY = Math.round(offsetY) || 0; | ||
if ((unitX === ' ' && offsetX !== 0) || (unitY === ' ' && offsetY !== 0) || (unitRadius === ' ' && radius !== 0)) { | ||
if ((unitX === ' ' && offsetX !== 0) || (unitY === ' ' && offsetY !== 0) || (unitRadius === ' ' && radius !== 0) || spread) { | ||
return properties; | ||
@@ -534,3 +534,3 @@ } | ||
// 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*([0-9\.]+)(px|em|rem| ))?\s*([a-z0-9\#\%\,\.\s\(\)]*)(?=\s*\))/i); | ||
if (fmatch !== null) { | ||
@@ -543,4 +543,6 @@ var offsetX = parseFloat(fmatch[2], 10), | ||
unitRadius = fmatch[7], | ||
color = fmatch[8]; | ||
properties = this.filters.dropShadow(offsetX, unitX, offsetY, unitY, radius, unitRadius, color); | ||
spread = parseFloat(fmatch[9], 10), | ||
unitSpread = fmatch[10], | ||
color = fmatch[11]; | ||
properties = this.filters.dropShadow(offsetX, unitX, offsetY, unitY, radius, unitRadius, spread, unitSpread, color); | ||
} | ||
@@ -655,2 +657,2 @@ | ||
module.exports = filter; | ||
module.exports = filter; |
{ | ||
"name": "pleeease-filters", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Convert CSS shorthand filters to SVG ones", | ||
@@ -5,0 +5,0 @@ "author": { |
@@ -0,0 +0,0 @@ Pleeease: filters |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
19506
533