postcss-pxtorem
Advanced tools
Comparing version 5.1.0 to 5.1.1
@@ -9,2 +9,2 @@ // excluding regex trick: http://www.rexegg.com/regex-best-trick.html | ||
module.exports = /"[^"]+"|'[^']+'|url\([^)]+\)|(\d*\.?\d+)px/g; | ||
module.exports = /"[^"]+"|'[^']+'|url\([^)]+\)|var\([^)]+\)|(\d*\.?\d+)px/g; |
{ | ||
"name": "postcss-pxtorem", | ||
"description": "A CSS post-processor that converts px to rem.", | ||
"version": "5.1.0", | ||
"version": "5.1.1", | ||
"author": "cuth", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -50,2 +50,15 @@ // Jasmine unit tests | ||
it("should ignore px in custom property names", function() { | ||
var rules = | ||
":root { --rem-14px: 14px; } .rule { font-size: var(--rem-14px); }"; | ||
var expected = | ||
":root { --rem-14px: 0.875rem; } .rule { font-size: var(--rem-14px); }"; | ||
var options = { | ||
propList: ["--*", "font-size"] | ||
}; | ||
var processed = postcss(pxtorem(options)).process(rules).css; | ||
expect(processed).toBe(expected); | ||
}); | ||
it("should handle < 1 values and values without a leading 0", function() { | ||
@@ -52,0 +65,0 @@ var rules = ".rule { margin: 0.5rem .5px -0.2px -.2em }"; |
29805
684