wix-style-processor
Advanced tools
Comparing version 3.0.127 to 3.1.0
@@ -12,2 +12,3 @@ export declare const defaultPlugins: { | ||
unit: (value: any, unit: any) => string; | ||
fallback: (...args: any[]) => any; | ||
}; |
@@ -43,3 +43,8 @@ var __assign = (this && this.__assign) || Object.assign || function(t) { | ||
} | ||
return new Color(colorValue).rgb().string(); | ||
else if (colorValue) { | ||
return new Color(colorValue).rgb().string(); | ||
} | ||
else { | ||
return ''; | ||
} | ||
} | ||
@@ -94,4 +99,12 @@ catch (e) { | ||
return "" + value + unit; | ||
}, | ||
fallback: function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var argsWithoutTPAparams = args.slice(0, -1); | ||
return argsWithoutTPAparams.filter(function (value) { return !!value; })[0]; | ||
} | ||
}; | ||
//# sourceMappingURL=defaultPlugins.js.map |
@@ -12,2 +12,3 @@ export declare const defaultPlugins: { | ||
unit: (value: any, unit: any) => string; | ||
fallback: (...args: any[]) => any; | ||
}; |
@@ -45,3 +45,8 @@ "use strict"; | ||
} | ||
return new Color(colorValue).rgb().string(); | ||
else if (colorValue) { | ||
return new Color(colorValue).rgb().string(); | ||
} | ||
else { | ||
return ''; | ||
} | ||
} | ||
@@ -96,4 +101,12 @@ catch (e) { | ||
return "" + value + unit; | ||
}, | ||
fallback: function () { | ||
var args = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
args[_i] = arguments[_i]; | ||
} | ||
var argsWithoutTPAparams = args.slice(0, -1); | ||
return argsWithoutTPAparams.filter(function (value) { return !!value; })[0]; | ||
} | ||
}; | ||
//# sourceMappingURL=defaultPlugins.js.map |
@@ -5,3 +5,3 @@ { | ||
"description": "An alternative Wix Styles TPA processor", | ||
"version": "3.0.127", | ||
"version": "3.1.0", | ||
"author": { | ||
@@ -8,0 +8,0 @@ "name": "Eran Shabi", |
# wix-style-processor | ||
##### An alternative Wix Styles TPA processor. | ||
This package provides a parser / transformer that scans your inlined CSS, and replaces its dynamic style declarations to the values defined by the user's website / template. | ||
This package provides a parser / transformer that scans your inline CSS, and replaces its dynamic style declarations to the values defined by the user's website / template. | ||
@@ -28,2 +28,3 @@ | ||
border-width: "unit(--var-from-settings, px)"; /* will produce border-width: 42px */ | ||
color: "fallback(color(--var-from-settings), color(color-8))"; /* will return the first none falsy value from left to right */ | ||
} | ||
@@ -30,0 +31,0 @@ ``` |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
416838
6533
149