@plumeria/compiler 18.3.16 → 18.3.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +7 -8
- package/package.json +2 -2
package/dist/index.js
CHANGED
|
@@ -104,18 +104,17 @@ const namedParamsOf = (params, defaults) => {
|
|
|
104
104
|
return named.length > 0 ? named : undefined;
|
|
105
105
|
};
|
|
106
106
|
const applyVarFallback = (style, cssVar, literal) => {
|
|
107
|
+
const reference = `var(${cssVar})`;
|
|
107
108
|
for (const [prop, value] of Object.entries(style)) {
|
|
108
|
-
if (typeof value === 'string' && value.includes(
|
|
109
|
-
style[prop] =
|
|
110
|
-
|
|
111
|
-
|
|
109
|
+
if (typeof value === 'string' && value.includes(reference)) {
|
|
110
|
+
style[prop] = value
|
|
111
|
+
.split(reference)
|
|
112
|
+
.join(`var(${cssVar}, ${(0, zss_engine_1.applyCssValue)(literal, (0, zss_engine_1.camelToKebabCase)(prop))})`);
|
|
112
113
|
}
|
|
113
|
-
if (value !== null && typeof value === 'object') {
|
|
114
|
-
|
|
115
|
-
return true;
|
|
114
|
+
else if (value !== null && typeof value === 'object') {
|
|
115
|
+
applyVarFallback(value, cssVar, literal);
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
|
-
return false;
|
|
119
118
|
};
|
|
120
119
|
const styleFunctionsOf = (objExpr) => {
|
|
121
120
|
const styleFunctions = {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plumeria/compiler",
|
|
3
|
-
"version": "18.3.
|
|
3
|
+
"version": "18.3.17",
|
|
4
4
|
"description": "Plumeria swc based compiler for statically extracting css",
|
|
5
5
|
"author": "Refirst 11",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dist/"
|
|
22
22
|
],
|
|
23
23
|
"dependencies": {
|
|
24
|
-
"@plumeria/utils": "^18.3.
|
|
24
|
+
"@plumeria/utils": "^18.3.17"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@rust-gear/glob": "1.1.1",
|