transform-to-unocss-core 0.0.55 → 0.0.57

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.cjs CHANGED
@@ -148,7 +148,7 @@ function animation(key, val) {
148
148
  const [value, important] = transformImportant(val);
149
149
  if (key === "animation-delay") return `animate-delay${getVal(value)}${important}`;
150
150
  if (key === "animation-duration") return `animate-duration${getVal(value)}${important}`;
151
- if (key === "animation-name") return `animate-[${value}]${important}`;
151
+ if (key === "animation-name") return `animate-name-[${value}]${important}`;
152
152
  if (key === "animation-timing-function") return `animate-ease-[${value}]${important}`;
153
153
  if (key === "animation-iteration-count") return `animate-count${getVal(value)}${important}`;
154
154
  if (key === "animation-direction") return `animate-direction-${value}${important}`;
@@ -463,6 +463,7 @@ function flex(key, val) {
463
463
  const [value, important] = transformImportant(val);
464
464
  if (lastMaps.includes(key)) return `${getLastName(key)}${getVal(value)}${important}`;
465
465
  if (value === "1") return `flex-1${important}`;
466
+ if (/^\d+$/.test(value)) return `flex-[${value}]${important}`;
466
467
  const firstVal = value[0];
467
468
  if (key === "flex" && (firstVal === "0" || firstVal === "1")) return `flex="[${joinWithUnderLine(value)}]${important}"`;
468
469
  return `${getFirstName(key)}-${value.replace("column", "col")}${important}`;
@@ -150,7 +150,7 @@ function animation(key, val) {
150
150
  const [value, important] = transformImportant(val);
151
151
  if (key === "animation-delay") return `animate-delay${getVal(value)}${important}`;
152
152
  if (key === "animation-duration") return `animate-duration${getVal(value)}${important}`;
153
- if (key === "animation-name") return `animate-[${value}]${important}`;
153
+ if (key === "animation-name") return `animate-name-[${value}]${important}`;
154
154
  if (key === "animation-timing-function") return `animate-ease-[${value}]${important}`;
155
155
  if (key === "animation-iteration-count") return `animate-count${getVal(value)}${important}`;
156
156
  if (key === "animation-direction") return `animate-direction-${value}${important}`;
@@ -465,6 +465,7 @@ function flex(key, val) {
465
465
  const [value, important] = transformImportant(val);
466
466
  if (lastMaps.includes(key)) return `${getLastName(key)}${getVal(value)}${important}`;
467
467
  if (value === "1") return `flex-1${important}`;
468
+ if (/^\d+$/.test(value)) return `flex-[${value}]${important}`;
468
469
  const firstVal = value[0];
469
470
  if (key === "flex" && (firstVal === "0" || firstVal === "1")) return `flex="[${joinWithUnderLine(value)}]${important}"`;
470
471
  return `${getFirstName(key)}-${value.replace("column", "col")}${important}`;
package/dist/index.js CHANGED
@@ -146,7 +146,7 @@ function animation(key, val) {
146
146
  const [value, important] = transformImportant(val);
147
147
  if (key === "animation-delay") return `animate-delay${getVal(value)}${important}`;
148
148
  if (key === "animation-duration") return `animate-duration${getVal(value)}${important}`;
149
- if (key === "animation-name") return `animate-[${value}]${important}`;
149
+ if (key === "animation-name") return `animate-name-[${value}]${important}`;
150
150
  if (key === "animation-timing-function") return `animate-ease-[${value}]${important}`;
151
151
  if (key === "animation-iteration-count") return `animate-count${getVal(value)}${important}`;
152
152
  if (key === "animation-direction") return `animate-direction-${value}${important}`;
@@ -461,6 +461,7 @@ function flex(key, val) {
461
461
  const [value, important] = transformImportant(val);
462
462
  if (lastMaps.includes(key)) return `${getLastName(key)}${getVal(value)}${important}`;
463
463
  if (value === "1") return `flex-1${important}`;
464
+ if (/^\d+$/.test(value)) return `flex-[${value}]${important}`;
464
465
  const firstVal = value[0];
465
466
  if (key === "flex" && (firstVal === "0" || firstVal === "1")) return `flex="[${joinWithUnderLine(value)}]${important}"`;
466
467
  return `${getFirstName(key)}-${value.replace("column", "col")}${important}`;
package/dist/index.umd.js CHANGED
@@ -153,7 +153,7 @@ function animation(key, val) {
153
153
  const [value, important] = transformImportant(val);
154
154
  if (key === "animation-delay") return `animate-delay${getVal(value)}${important}`;
155
155
  if (key === "animation-duration") return `animate-duration${getVal(value)}${important}`;
156
- if (key === "animation-name") return `animate-[${value}]${important}`;
156
+ if (key === "animation-name") return `animate-name-[${value}]${important}`;
157
157
  if (key === "animation-timing-function") return `animate-ease-[${value}]${important}`;
158
158
  if (key === "animation-iteration-count") return `animate-count${getVal(value)}${important}`;
159
159
  if (key === "animation-direction") return `animate-direction-${value}${important}`;
@@ -468,6 +468,7 @@ function flex(key, val) {
468
468
  const [value, important] = transformImportant(val);
469
469
  if (lastMaps.includes(key)) return `${getLastName(key)}${getVal(value)}${important}`;
470
470
  if (value === "1") return `flex-1${important}`;
471
+ if (/^\d+$/.test(value)) return `flex-[${value}]${important}`;
471
472
  const firstVal = value[0];
472
473
  if (key === "flex" && (firstVal === "0" || firstVal === "1")) return `flex="[${joinWithUnderLine(value)}]${important}"`;
473
474
  return `${getFirstName(key)}-${value.replace("column", "col")}${important}`;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "transform-to-unocss-core",
3
3
  "type": "module",
4
- "version": "0.0.55",
4
+ "version": "0.0.57",
5
5
  "description": "A utility to transform CSS to UnoCSS syntax. Supports various CSS properties and custom parsing.",
6
6
  "author": "Simon He",
7
7
  "license": "MIT",