Skip to content
This repository has been archived by the owner on Mar 22, 2019. It is now read-only.

Commit

Permalink
Merge pull request #86 from hail2u/issue85
Browse files Browse the repository at this point in the history
Don’t remove unit of 0 from custom property value
  • Loading branch information
hail2u committed Aug 21, 2017
2 parents 569b3a9 + e656fba commit c2a91a1
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
3 changes: 2 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ function removeUnitOfZero(prop, m, leading, num, u, position, value) {
prop === "-webkit-flex" ||
prop === "flex-basis" ||
prop === "-webkit-flex-basis" ||
value.indexOf("calc(") !== -1
value.indexOf("calc(") !== -1 ||
prop.startsWith("--")
) {
return m;
}
Expand Down
1 change: 1 addition & 0 deletions test/expected/issue85.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
:root{--foo:0px}.foo{top:calc(var(--foo))}
7 changes: 7 additions & 0 deletions test/fixtures/issue85.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
:root {
--foo: 0px;
}

.foo {
top: calc(var(--foo));
}

0 comments on commit c2a91a1

Please sign in to comment.