postcss-preset-mantine
Advanced tools
@@ -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 }); |
+1
-1
| { | ||
| "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
13296
3.27%192
7.26%