@unocss/transformer-variant-group 0.43.2 → 0.44.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 -6
- package/dist/index.d.ts +19 -2
- package/dist/index.mjs +3 -7
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -2,16 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
const core = require('@unocss/core');
|
|
4
4
|
|
|
5
|
-
function transformerVariantGroup() {
|
|
5
|
+
function transformerVariantGroup(options = {}) {
|
|
6
6
|
return {
|
|
7
7
|
name: "variant-group",
|
|
8
8
|
enforce: "pre",
|
|
9
9
|
transform(s) {
|
|
10
|
-
core.
|
|
11
|
-
details: true,
|
|
12
|
-
templateStaticOnly: true,
|
|
13
|
-
deep: true
|
|
14
|
-
}).filter(({ value: { length } }) => length).forEach(({ value, range }) => s.overwrite(...range, core.expandVariantGroup(value)));
|
|
10
|
+
core.expandVariantGroup(s, options.separators);
|
|
15
11
|
}
|
|
16
12
|
};
|
|
17
13
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
import { SourceCodeTransformer } from '@unocss/core';
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
interface TransformerVariantGroupOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Separators to expand.
|
|
6
|
+
*
|
|
7
|
+
* ```
|
|
8
|
+
* foo-(bar baz) -> foo-bar foo-baz
|
|
9
|
+
* ^
|
|
10
|
+
* separator
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* You may set it to `[':']` for strictness.
|
|
14
|
+
*
|
|
15
|
+
* @default [':', '-']
|
|
16
|
+
* @see https://github.com/unocss/unocss/pull/1231
|
|
17
|
+
*/
|
|
18
|
+
separators?: (':' | '-')[];
|
|
19
|
+
}
|
|
20
|
+
declare function transformerVariantGroup(options?: TransformerVariantGroupOptions): SourceCodeTransformer;
|
|
4
21
|
|
|
5
|
-
export { transformerVariantGroup as default };
|
|
22
|
+
export { TransformerVariantGroupOptions, transformerVariantGroup as default };
|
package/dist/index.mjs
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { expandVariantGroup } from '@unocss/core';
|
|
2
2
|
|
|
3
|
-
function transformerVariantGroup() {
|
|
3
|
+
function transformerVariantGroup(options = {}) {
|
|
4
4
|
return {
|
|
5
5
|
name: "variant-group",
|
|
6
6
|
enforce: "pre",
|
|
7
7
|
transform(s) {
|
|
8
|
-
|
|
9
|
-
details: true,
|
|
10
|
-
templateStaticOnly: true,
|
|
11
|
-
deep: true
|
|
12
|
-
}).filter(({ value: { length } }) => length).forEach(({ value, range }) => s.overwrite(...range, expandVariantGroup(value)));
|
|
8
|
+
expandVariantGroup(s, options.separators);
|
|
13
9
|
}
|
|
14
10
|
};
|
|
15
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@unocss/transformer-variant-group",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.44.0",
|
|
4
4
|
"description": "Variant group transformer for UnoCSS",
|
|
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.44.0"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
38
|
"magic-string": "^0.26.2"
|