@plumeria/compiler 18.3.15 → 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.
Files changed (2) hide show
  1. package/dist/index.js +7 -8
  2. package/package.json +3 -3
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(cssVar)) {
109
- style[prop] =
110
- `var(${cssVar}, ${(0, zss_engine_1.applyCssValue)(literal, (0, zss_engine_1.camelToKebabCase)(prop))})`;
111
- return true;
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
- if (applyVarFallback(value, cssVar, literal))
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.15",
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,12 +21,12 @@
21
21
  "dist/"
22
22
  ],
23
23
  "dependencies": {
24
- "@plumeria/utils": "^18.3.15"
24
+ "@plumeria/utils": "^18.3.17"
25
25
  },
26
26
  "devDependencies": {
27
27
  "@rust-gear/glob": "1.1.1",
28
28
  "@swc/core": "1.15.47",
29
- "zss-engine": "2.6.0"
29
+ "zss-engine": "2.7.0"
30
30
  },
31
31
  "publishConfig": {
32
32
  "access": "public",