Permalink
Browse files

Fixes #911 Percentage calculation value not copied

  • Loading branch information...
1 parent c2b56a9 commit d1af943343d58585f2d536ce883bd58d51d00c94 @tonistiigi committed Dec 5, 2012
Showing with 9 additions and 1 deletion.
  1. +1 −1 lib/nodes/unit.js
  2. +4 −0 test/cases/regression.911.css
  3. +4 −0 test/cases/regression.911.styl
View
@@ -95,7 +95,7 @@ Unit.prototype.operate = function(op, right){
right = right.first;
// percentages
if (('-' == op || '+' == op) && '%' == right.type) {
- right.val = this.val * (right.val / 100);
+ right = new Unit(this.val * (right.val / 100), '%');
} else {
right = this.coerce(right);
}
@@ -0,0 +1,4 @@
+.foo {
+ margin-left: 10%;
+ width: 55%;
+}
@@ -0,0 +1,4 @@
+.foo
+ space = 10%
+ margin-left: space
+ width: 50% + space

0 comments on commit d1af943

Please sign in to comment.