@unocss/transformer-compile-class 0.44.0 → 0.44.1

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
@@ -12,13 +12,13 @@ function transformerCompileClass(options = {}) {
12
12
  const regex = new RegExp(`(["'\`])${core.escapeRegExp(trigger)}\\s([^\\1]*?)\\1`, "g");
13
13
  return {
14
14
  name: "compile-class",
15
- enforce: "pre",
15
+ enforce: "post",
16
16
  async transform(s, _, { uno }) {
17
17
  const matches = [...s.original.matchAll(regex)];
18
18
  if (!matches.length)
19
19
  return;
20
20
  for (const match of matches) {
21
- let body = match[2].trim();
21
+ let body = core.expandVariantGroup(match[2].trim());
22
22
  const start = match.index;
23
23
  const replacements = [];
24
24
  if (keepUnknown) {
package/dist/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { escapeRegExp } from '@unocss/core';
1
+ import { escapeRegExp, expandVariantGroup } from '@unocss/core';
2
2
 
3
3
  function transformerCompileClass(options = {}) {
4
4
  const {
@@ -10,13 +10,13 @@ function transformerCompileClass(options = {}) {
10
10
  const regex = new RegExp(`(["'\`])${escapeRegExp(trigger)}\\s([^\\1]*?)\\1`, "g");
11
11
  return {
12
12
  name: "compile-class",
13
- enforce: "pre",
13
+ enforce: "post",
14
14
  async transform(s, _, { uno }) {
15
15
  const matches = [...s.original.matchAll(regex)];
16
16
  if (!matches.length)
17
17
  return;
18
18
  for (const match of matches) {
19
- let body = match[2].trim();
19
+ let body = expandVariantGroup(match[2].trim());
20
20
  const start = match.index;
21
21
  const replacements = [];
22
22
  if (keepUnknown) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/transformer-compile-class",
3
- "version": "0.44.0",
3
+ "version": "0.44.1",
4
4
  "description": "Compile group of classes into one class",
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.44.0"
35
+ "@unocss/core": "0.44.1"
36
36
  },
37
37
  "devDependencies": {
38
38
  "magic-string": "^0.26.2"