Permalink
Browse files

fix rgba() with arity > 2

  • Loading branch information...
tj committed Dec 4, 2012
1 parent 87b2a6b commit e2579644e87892713854b798388416196ea6ec7e
Showing with 11 additions and 0 deletions.
  1. +3 −0 lib/plugins/colors.js
  2. +4 −0 test/fixtures/colors.css
  3. +4 −0 test/fixtures/colors.out.css
View
@@ -45,6 +45,9 @@ function substitute(declarations) {
// grab rgba(...) value
var rgba = val.slice(index, val.indexOf(')', index));
+ // arity > 2
+ if (rgba.split(',').length > 2) continue;
+
// color
var c = rgba.slice(rgba.indexOf('(') + 1, rgba.indexOf(',')).trim();
c = parse(c);
View
@@ -9,4 +9,8 @@ button {
button {
background: rgba(#ffcc00, 0.2);
+}
+
+button {
+ background: rgba(204, 100, 0, .2)
}
@@ -8,4 +8,8 @@ button {
button {
background: rgba(255,204,0,0.2)
+}
+
+button {
+ background: rgba(204, 100, 0, .2)
}

0 comments on commit e257964

Please sign in to comment.