@unocss/core 0.42.0 → 0.42.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
@@ -460,7 +460,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
460
460
  };
461
461
  }
462
462
 
463
- const version = "0.42.0";
463
+ const version = "0.42.1";
464
464
 
465
465
  class UnoGenerator {
466
466
  constructor(userConfig = {}, defaults = {}) {
@@ -833,8 +833,19 @@ class UnoGenerator {
833
833
  }
834
834
  if (typeof result === "string")
835
835
  result = expandVariantGroup(result).split(/\s+/g);
836
- if (!result)
836
+ if (!result) {
837
+ const [raw, rematchedProcess] = typeof processed === "string" ? this.matchVariants(processed) : processed;
838
+ if (raw !== rematchedProcess) {
839
+ const expanded = this.expandShortcut(rematchedProcess, context, depth - 1);
840
+ if (expanded) {
841
+ expanded[0].forEach((item, index) => {
842
+ expanded[0][index] = raw.replace(rematchedProcess, item);
843
+ });
844
+ return expanded;
845
+ }
846
+ }
837
847
  return;
848
+ }
838
849
  return [
839
850
  result.flatMap((r) => this.expandShortcut(r, context, depth - 1)?.[0] || [r]).filter((r) => r !== ""),
840
851
  meta
package/dist/index.mjs CHANGED
@@ -456,7 +456,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
456
456
  };
457
457
  }
458
458
 
459
- const version = "0.42.0";
459
+ const version = "0.42.1";
460
460
 
461
461
  class UnoGenerator {
462
462
  constructor(userConfig = {}, defaults = {}) {
@@ -829,8 +829,19 @@ class UnoGenerator {
829
829
  }
830
830
  if (typeof result === "string")
831
831
  result = expandVariantGroup(result).split(/\s+/g);
832
- if (!result)
832
+ if (!result) {
833
+ const [raw, rematchedProcess] = typeof processed === "string" ? this.matchVariants(processed) : processed;
834
+ if (raw !== rematchedProcess) {
835
+ const expanded = this.expandShortcut(rematchedProcess, context, depth - 1);
836
+ if (expanded) {
837
+ expanded[0].forEach((item, index) => {
838
+ expanded[0][index] = raw.replace(rematchedProcess, item);
839
+ });
840
+ return expanded;
841
+ }
842
+ }
833
843
  return;
844
+ }
834
845
  return [
835
846
  result.flatMap((r) => this.expandShortcut(r, context, depth - 1)?.[0] || [r]).filter((r) => r !== ""),
836
847
  meta
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/core",
3
- "version": "0.42.0",
3
+ "version": "0.42.1",
4
4
  "description": "The instant on-demand Atomic CSS engine.",
5
5
  "author": "Anthony Fu <anthonyfu117@hotmail.com>",
6
6
  "license": "MIT",