@unocss/core 0.20.2 → 0.20.4

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
@@ -249,7 +249,6 @@ function createValueHandler(handlers) {
249
249
  if (res != null)
250
250
  return res;
251
251
  }
252
- return void 0;
253
252
  };
254
253
  function addProcessor(that, name) {
255
254
  if (!that.__options) {
@@ -363,7 +362,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
363
362
  };
364
363
  }
365
364
 
366
- const version = "0.20.2";
365
+ const version = "0.20.4";
367
366
 
368
367
  class UnoGenerator {
369
368
  constructor(userConfig = {}, defaults = {}) {
@@ -480,13 +479,7 @@ class UnoGenerator {
480
479
  const getLayer = (layer) => {
481
480
  if (layerCache[layer])
482
481
  return layerCache[layer];
483
- let css = Array.from(sheet).sort((a, b) => {
484
- const parentOrderA = this.parentOrders.get(a[0]);
485
- const parentOrderB = this.parentOrders.get(b[0]);
486
- if (parentOrderA !== void 0 && parentOrderB !== void 0)
487
- return parentOrderA - parentOrderB;
488
- return a[0]?.localeCompare(b[0] || "");
489
- }).map(([parent, items]) => {
482
+ let css = Array.from(sheet).sort((a, b) => (this.parentOrders.get(a[0]) ?? 0) - (this.parentOrders.get(b[0]) ?? 0) || a[0]?.localeCompare(b[0] || "") || 0).map(([parent, items]) => {
490
483
  const size = items.length;
491
484
  const sorted = items.filter((i) => (i[4]?.layer || "default") === layer).sort((a, b) => a[0] - b[0] || a[1]?.localeCompare(b[1] || "") || 0).map((a) => [a[1] ? applyScope(a[1], scope) : a[1], a[2]]);
492
485
  if (!sorted.length)
@@ -496,7 +489,7 @@ class UnoGenerator {
496
489
  for (let i = idx + 1; i < size; i++) {
497
490
  const current = sorted[i];
498
491
  if (current && current[0] && current[1] === body) {
499
- current[0] = `${current[0]},${selector}`;
492
+ current[0] = `${current[0]},${nl}${selector}`;
500
493
  return null;
501
494
  }
502
495
  }
package/dist/index.mjs CHANGED
@@ -245,7 +245,6 @@ function createValueHandler(handlers) {
245
245
  if (res != null)
246
246
  return res;
247
247
  }
248
- return void 0;
249
248
  };
250
249
  function addProcessor(that, name) {
251
250
  if (!that.__options) {
@@ -359,7 +358,7 @@ function resolveConfig(userConfig = {}, defaults = {}) {
359
358
  };
360
359
  }
361
360
 
362
- const version = "0.20.2";
361
+ const version = "0.20.4";
363
362
 
364
363
  class UnoGenerator {
365
364
  constructor(userConfig = {}, defaults = {}) {
@@ -476,13 +475,7 @@ class UnoGenerator {
476
475
  const getLayer = (layer) => {
477
476
  if (layerCache[layer])
478
477
  return layerCache[layer];
479
- let css = Array.from(sheet).sort((a, b) => {
480
- const parentOrderA = this.parentOrders.get(a[0]);
481
- const parentOrderB = this.parentOrders.get(b[0]);
482
- if (parentOrderA !== void 0 && parentOrderB !== void 0)
483
- return parentOrderA - parentOrderB;
484
- return a[0]?.localeCompare(b[0] || "");
485
- }).map(([parent, items]) => {
478
+ let css = Array.from(sheet).sort((a, b) => (this.parentOrders.get(a[0]) ?? 0) - (this.parentOrders.get(b[0]) ?? 0) || a[0]?.localeCompare(b[0] || "") || 0).map(([parent, items]) => {
486
479
  const size = items.length;
487
480
  const sorted = items.filter((i) => (i[4]?.layer || "default") === layer).sort((a, b) => a[0] - b[0] || a[1]?.localeCompare(b[1] || "") || 0).map((a) => [a[1] ? applyScope(a[1], scope) : a[1], a[2]]);
488
481
  if (!sorted.length)
@@ -492,7 +485,7 @@ class UnoGenerator {
492
485
  for (let i = idx + 1; i < size; i++) {
493
486
  const current = sorted[i];
494
487
  if (current && current[0] && current[1] === body) {
495
- current[0] = `${current[0]},${selector}`;
488
+ current[0] = `${current[0]},${nl}${selector}`;
496
489
  return null;
497
490
  }
498
491
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unocss/core",
3
- "version": "0.20.2",
3
+ "version": "0.20.4",
4
4
  "description": "The instant on-demand Atomic CSS engine.",
5
5
  "keywords": [
6
6
  "unocss",