wix-style-processor
Advanced tools
Comparing version 3.1.8 to 3.1.9
@@ -14,2 +14,3 @@ export declare const defaultPlugins: { | ||
zeroAsTrue: (zero: any) => any; | ||
calc: (operator: any, ...args: any[]) => any; | ||
}; |
@@ -109,4 +109,17 @@ var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
return (typeof zero === 'number') ? "" + zero : zero; | ||
} | ||
}, | ||
calc: function (operator) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
var numbersWithoutTPAParams = args.slice(0, -1); | ||
if (numbersWithoutTPAParams.length > 1) { | ||
return "calc(" + numbersWithoutTPAParams.join(" " + operator + " ") + ")"; | ||
} | ||
else { | ||
return numbersWithoutTPAParams[0]; | ||
} | ||
}, | ||
}; | ||
//# sourceMappingURL=defaultPlugins.js.map |
@@ -14,2 +14,3 @@ export declare const defaultPlugins: { | ||
zeroAsTrue: (zero: any) => any; | ||
calc: (operator: any, ...args: any[]) => any; | ||
}; |
@@ -111,4 +111,17 @@ "use strict"; | ||
return (typeof zero === 'number') ? "" + zero : zero; | ||
} | ||
}, | ||
calc: function (operator) { | ||
var args = []; | ||
for (var _i = 1; _i < arguments.length; _i++) { | ||
args[_i - 1] = arguments[_i]; | ||
} | ||
var numbersWithoutTPAParams = args.slice(0, -1); | ||
if (numbersWithoutTPAParams.length > 1) { | ||
return "calc(" + numbersWithoutTPAParams.join(" " + operator + " ") + ")"; | ||
} | ||
else { | ||
return numbersWithoutTPAParams[0]; | ||
} | ||
}, | ||
}; | ||
//# sourceMappingURL=defaultPlugins.js.map |
@@ -5,3 +5,3 @@ { | ||
"description": "An alternative Wix Styles TPA processor", | ||
"version": "3.1.8", | ||
"version": "3.1.9", | ||
"author": { | ||
@@ -8,0 +8,0 @@ "name": "Eran Shabi", |
@@ -29,2 +29,3 @@ # wix-style-processor | ||
color: "fallback(color(--var-from-settings), color(color-8))"; /* will return the first none falsy value from left to right */ | ||
width: "calc(+, 2px, 4%, 3em)"; /* will return the native calc function for the given operator and numbers a work around for https://github.com/thysultan/stylis.js/issues/116 */ | ||
} | ||
@@ -31,0 +32,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
425703
6669
150