postcss-preset-mantine
Advanced tools
Comparing version 1.9.1 to 1.10.0
@@ -7,3 +7,6 @@ "use strict"; | ||
function createConverter(units, { shouldScale = false } = {}) { | ||
return (value) => { | ||
function converter(value) { | ||
if (value === 0 || value === '0') { | ||
return '0'; | ||
} | ||
if (typeof value === 'number') { | ||
@@ -14,2 +17,11 @@ const val = `${value / 16}${units}`; | ||
if (typeof value === 'string') { | ||
if (value.startsWith('calc(') || value.startsWith('var(')) { | ||
return value; | ||
} | ||
if (value.includes(' ')) { | ||
return value | ||
.split(' ') | ||
.map((val) => converter(val)) | ||
.join(' '); | ||
} | ||
if (value.includes(units)) { | ||
@@ -25,3 +37,4 @@ return shouldScale ? scaleRem(value) : value; | ||
return value; | ||
}; | ||
} | ||
return converter; | ||
} | ||
@@ -28,0 +41,0 @@ const rem = createConverter('rem', { shouldScale: true }); |
{ | ||
"name": "postcss-preset-mantine", | ||
"version": "1.9.1", | ||
"version": "1.10.0", | ||
"description": "PostCSS preset for Mantine (7.0+) applications", | ||
@@ -5,0 +5,0 @@ "main": "dist/preset.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13296
192