@plumeria/unplugin 18.1.8 → 18.1.9

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/core.js CHANGED
@@ -953,16 +953,19 @@ const unpluginFactory = (options = {}, unpluginMeta) => {
953
953
  .subarray(argStart, argEnd)
954
954
  .toString('utf-8');
955
955
  let valueExpr;
956
+ const kebabProp = (0, zss_engine_1.camelToKebabCase)(targetProp);
957
+ const isUnitless = zss_engine_1.exceptionCamelCase.includes(targetProp) ||
958
+ targetProp.startsWith('--');
956
959
  const maybeNumber = Number(argSource);
957
960
  if (!isNaN(maybeNumber) && argSource.trim() === String(maybeNumber)) {
958
- valueExpr = JSON.stringify((0, zss_engine_1.applyCssValue)(maybeNumber, targetProp));
961
+ valueExpr = JSON.stringify((0, zss_engine_1.applyCssValue)(maybeNumber, kebabProp));
959
962
  }
960
963
  else if ((argSource.startsWith('"') && argSource.endsWith('"')) ||
961
964
  (argSource.startsWith("'") && argSource.endsWith("'"))) {
962
- valueExpr = JSON.stringify((0, zss_engine_1.applyCssValue)(argSource.slice(1, -1), targetProp));
965
+ valueExpr = JSON.stringify((0, zss_engine_1.applyCssValue)(argSource.slice(1, -1), kebabProp));
963
966
  }
964
967
  else {
965
- valueExpr = zss_engine_1.exceptionCamelCase.includes(targetProp)
968
+ valueExpr = isUnitless
966
969
  ? argSource
967
970
  : `(typeof (${argSource}) === 'number' ? (${argSource}) + 'px' : (${argSource}))`;
968
971
  }
package/dist/core.mjs CHANGED
@@ -917,16 +917,19 @@ export const unpluginFactory = (options = {}, unpluginMeta) => {
917
917
  .subarray(argStart, argEnd)
918
918
  .toString('utf-8');
919
919
  let valueExpr;
920
+ const kebabProp = camelToKebabCase(targetProp);
921
+ const isUnitless = exceptionCamelCase.includes(targetProp) ||
922
+ targetProp.startsWith('--');
920
923
  const maybeNumber = Number(argSource);
921
924
  if (!isNaN(maybeNumber) && argSource.trim() === String(maybeNumber)) {
922
- valueExpr = JSON.stringify(applyCssValue(maybeNumber, targetProp));
925
+ valueExpr = JSON.stringify(applyCssValue(maybeNumber, kebabProp));
923
926
  }
924
927
  else if ((argSource.startsWith('"') && argSource.endsWith('"')) ||
925
928
  (argSource.startsWith("'") && argSource.endsWith("'"))) {
926
- valueExpr = JSON.stringify(applyCssValue(argSource.slice(1, -1), targetProp));
929
+ valueExpr = JSON.stringify(applyCssValue(argSource.slice(1, -1), kebabProp));
927
930
  }
928
931
  else {
929
- valueExpr = exceptionCamelCase.includes(targetProp)
932
+ valueExpr = isUnitless
930
933
  ? argSource
931
934
  : `(typeof (${argSource}) === 'number' ? (${argSource}) + 'px' : (${argSource}))`;
932
935
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@plumeria/unplugin",
3
- "version": "18.1.8",
3
+ "version": "18.1.9",
4
4
  "description": "Universal Plumeria plugin for various build tools",
5
5
  "author": "Refirst 11",
6
6
  "license": "MIT",
@@ -89,7 +89,7 @@
89
89
  "dependencies": {
90
90
  "@rollup/pluginutils": "^5.4.0",
91
91
  "unplugin": "^3.0.0",
92
- "@plumeria/utils": "^18.1.8"
92
+ "@plumeria/utils": "^18.1.9"
93
93
  },
94
94
  "devDependencies": {
95
95
  "@swc/core": "1.15.47",