transform-to-unocss-core 0.0.52 → 0.0.54
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 +17 -1
- package/dist/index.iife.js +17 -1
- package/dist/index.js +17 -1
- package/dist/index.umd.js +17 -1
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -478,7 +478,16 @@ function float(key, val) {
|
|
|
478
478
|
//#region src/font.ts
|
|
479
479
|
function font(key, val) {
|
|
480
480
|
const [value, important] = transformImportant(val);
|
|
481
|
-
if (key === "font-size")
|
|
481
|
+
if (key === "font-size") {
|
|
482
|
+
if ([
|
|
483
|
+
"inherit",
|
|
484
|
+
"initial",
|
|
485
|
+
"revert",
|
|
486
|
+
"unset",
|
|
487
|
+
"revert-layer"
|
|
488
|
+
].includes(value)) return `font-size-${value}${important}`;
|
|
489
|
+
return `text-${value}${important}`;
|
|
490
|
+
}
|
|
482
491
|
if (key === "font-weight") return `font-${value}${important}`;
|
|
483
492
|
if (key === "font-family") {
|
|
484
493
|
const match = value.match(/ui-(\w{0,4})/);
|
|
@@ -794,6 +803,13 @@ function text(key, val) {
|
|
|
794
803
|
}
|
|
795
804
|
if (key.startsWith("text-decoration") || key === "text-indent") return `${key.split("-")[1]}${getVal(value)}${important}`;
|
|
796
805
|
if (key === "text-underline-offset") return `underline-offset-${value}${important}`;
|
|
806
|
+
if ([
|
|
807
|
+
"inherit",
|
|
808
|
+
"initial",
|
|
809
|
+
"revert",
|
|
810
|
+
"unset",
|
|
811
|
+
"revert-layer"
|
|
812
|
+
].includes(value)) return `${important}text-align-${value}`;
|
|
797
813
|
return `text-${value}${important}`;
|
|
798
814
|
}
|
|
799
815
|
|
package/dist/index.iife.js
CHANGED
|
@@ -480,7 +480,16 @@ function float(key, val) {
|
|
|
480
480
|
//#region src/font.ts
|
|
481
481
|
function font(key, val) {
|
|
482
482
|
const [value, important] = transformImportant(val);
|
|
483
|
-
if (key === "font-size")
|
|
483
|
+
if (key === "font-size") {
|
|
484
|
+
if ([
|
|
485
|
+
"inherit",
|
|
486
|
+
"initial",
|
|
487
|
+
"revert",
|
|
488
|
+
"unset",
|
|
489
|
+
"revert-layer"
|
|
490
|
+
].includes(value)) return `font-size-${value}${important}`;
|
|
491
|
+
return `text-${value}${important}`;
|
|
492
|
+
}
|
|
484
493
|
if (key === "font-weight") return `font-${value}${important}`;
|
|
485
494
|
if (key === "font-family") {
|
|
486
495
|
const match = value.match(/ui-(\w{0,4})/);
|
|
@@ -796,6 +805,13 @@ function text(key, val) {
|
|
|
796
805
|
}
|
|
797
806
|
if (key.startsWith("text-decoration") || key === "text-indent") return `${key.split("-")[1]}${getVal(value)}${important}`;
|
|
798
807
|
if (key === "text-underline-offset") return `underline-offset-${value}${important}`;
|
|
808
|
+
if ([
|
|
809
|
+
"inherit",
|
|
810
|
+
"initial",
|
|
811
|
+
"revert",
|
|
812
|
+
"unset",
|
|
813
|
+
"revert-layer"
|
|
814
|
+
].includes(value)) return `${important}text-align-${value}`;
|
|
799
815
|
return `text-${value}${important}`;
|
|
800
816
|
}
|
|
801
817
|
|
package/dist/index.js
CHANGED
|
@@ -476,7 +476,16 @@ function float(key, val) {
|
|
|
476
476
|
//#region src/font.ts
|
|
477
477
|
function font(key, val) {
|
|
478
478
|
const [value, important] = transformImportant(val);
|
|
479
|
-
if (key === "font-size")
|
|
479
|
+
if (key === "font-size") {
|
|
480
|
+
if ([
|
|
481
|
+
"inherit",
|
|
482
|
+
"initial",
|
|
483
|
+
"revert",
|
|
484
|
+
"unset",
|
|
485
|
+
"revert-layer"
|
|
486
|
+
].includes(value)) return `font-size-${value}${important}`;
|
|
487
|
+
return `text-${value}${important}`;
|
|
488
|
+
}
|
|
480
489
|
if (key === "font-weight") return `font-${value}${important}`;
|
|
481
490
|
if (key === "font-family") {
|
|
482
491
|
const match = value.match(/ui-(\w{0,4})/);
|
|
@@ -792,6 +801,13 @@ function text(key, val) {
|
|
|
792
801
|
}
|
|
793
802
|
if (key.startsWith("text-decoration") || key === "text-indent") return `${key.split("-")[1]}${getVal(value)}${important}`;
|
|
794
803
|
if (key === "text-underline-offset") return `underline-offset-${value}${important}`;
|
|
804
|
+
if ([
|
|
805
|
+
"inherit",
|
|
806
|
+
"initial",
|
|
807
|
+
"revert",
|
|
808
|
+
"unset",
|
|
809
|
+
"revert-layer"
|
|
810
|
+
].includes(value)) return `${important}text-align-${value}`;
|
|
795
811
|
return `text-${value}${important}`;
|
|
796
812
|
}
|
|
797
813
|
|
package/dist/index.umd.js
CHANGED
|
@@ -483,7 +483,16 @@ function float(key, val) {
|
|
|
483
483
|
//#region src/font.ts
|
|
484
484
|
function font(key, val) {
|
|
485
485
|
const [value, important] = transformImportant(val);
|
|
486
|
-
if (key === "font-size")
|
|
486
|
+
if (key === "font-size") {
|
|
487
|
+
if ([
|
|
488
|
+
"inherit",
|
|
489
|
+
"initial",
|
|
490
|
+
"revert",
|
|
491
|
+
"unset",
|
|
492
|
+
"revert-layer"
|
|
493
|
+
].includes(value)) return `font-size-${value}${important}`;
|
|
494
|
+
return `text-${value}${important}`;
|
|
495
|
+
}
|
|
487
496
|
if (key === "font-weight") return `font-${value}${important}`;
|
|
488
497
|
if (key === "font-family") {
|
|
489
498
|
const match = value.match(/ui-(\w{0,4})/);
|
|
@@ -799,6 +808,13 @@ function text(key, val) {
|
|
|
799
808
|
}
|
|
800
809
|
if (key.startsWith("text-decoration") || key === "text-indent") return `${key.split("-")[1]}${getVal(value)}${important}`;
|
|
801
810
|
if (key === "text-underline-offset") return `underline-offset-${value}${important}`;
|
|
811
|
+
if ([
|
|
812
|
+
"inherit",
|
|
813
|
+
"initial",
|
|
814
|
+
"revert",
|
|
815
|
+
"unset",
|
|
816
|
+
"revert-layer"
|
|
817
|
+
].includes(value)) return `${important}text-align-${value}`;
|
|
802
818
|
return `text-${value}${important}`;
|
|
803
819
|
}
|
|
804
820
|
|
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.
|
|
4
|
+
"version": "0.0.54",
|
|
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",
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@antfu/eslint-config": "^4.13.0",
|
|
65
|
-
"@types/node": "^18.19.
|
|
65
|
+
"@types/node": "^18.19.100",
|
|
66
66
|
"bumpp": "^8.2.1",
|
|
67
67
|
"eslint": "^9.26.0",
|
|
68
68
|
"esno": "^0.16.3",
|