@unocss/preset-legacy-compat 0.59.4 → 0.60.0
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 +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -5,11 +5,11 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
const core = require('@unocss/core');
|
|
6
6
|
|
|
7
7
|
function toCommaStyleColorFunction(str) {
|
|
8
|
-
return str.replace(/(rgb|hsl)a
|
|
8
|
+
return str.replace(/((?:rgb|hsl)a?)\(([^)]+)\)/g, (_, fn, v) => {
|
|
9
9
|
const [rgb, alpha] = v.split(/\//g).map((i) => i.trim());
|
|
10
10
|
if (alpha && !fn.endsWith("a"))
|
|
11
11
|
fn += "a";
|
|
12
|
-
const parts = rgb.split(
|
|
12
|
+
const parts = rgb.split(/,?\s+/).map((i) => i.trim());
|
|
13
13
|
if (alpha)
|
|
14
14
|
parts.push(alpha);
|
|
15
15
|
return `${fn}(${parts.filter(Boolean).join(", ")})`;
|
package/dist/index.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { definePreset } from '@unocss/core';
|
|
2
2
|
|
|
3
3
|
function toCommaStyleColorFunction(str) {
|
|
4
|
-
return str.replace(/(rgb|hsl)a
|
|
4
|
+
return str.replace(/((?:rgb|hsl)a?)\(([^)]+)\)/g, (_, fn, v) => {
|
|
5
5
|
const [rgb, alpha] = v.split(/\//g).map((i) => i.trim());
|
|
6
6
|
if (alpha && !fn.endsWith("a"))
|
|
7
7
|
fn += "a";
|
|
8
|
-
const parts = rgb.split(
|
|
8
|
+
const parts = rgb.split(/,?\s+/).map((i) => i.trim());
|
|
9
9
|
if (alpha)
|
|
10
10
|
parts.push(alpha);
|
|
11
11
|
return `${fn}(${parts.filter(Boolean).join(", ")})`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/preset-legacy-compat",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.60.0",
|
|
4
4
|
"description": "Collections of legacy compatibility utilities.",
|
|
5
5
|
"author": "Anthony Fu <anthonyfu117@hotmail.com>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@unocss/core": "0.
|
|
35
|
+
"@unocss/core": "0.60.0"
|
|
36
36
|
},
|
|
37
37
|
"scripts": {
|
|
38
38
|
"build": "unbuild",
|