@alivecss/aliveui 1.0.2 → 1.0.5

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/cli.js CHANGED
@@ -585,6 +585,9 @@ function generateBase(_config) {
585
585
  ::before,
586
586
  ::after {
587
587
  box-sizing: border-box;
588
+ border-width: 0;
589
+ border-style: solid;
590
+ border-color: currentColor;
588
591
  }
589
592
 
590
593
  html {
@@ -604,6 +607,39 @@ body {
604
607
  -moz-osx-font-smoothing: grayscale;
605
608
  }
606
609
 
610
+ blockquote,
611
+ dl,
612
+ dd,
613
+ h1,
614
+ h2,
615
+ h3,
616
+ h4,
617
+ h5,
618
+ h6,
619
+ hr,
620
+ figure,
621
+ p,
622
+ pre {
623
+ margin: 0;
624
+ }
625
+
626
+ fieldset {
627
+ margin: 0;
628
+ padding: 0;
629
+ }
630
+
631
+ legend {
632
+ padding: 0;
633
+ }
634
+
635
+ ol,
636
+ ul,
637
+ menu {
638
+ list-style: none;
639
+ margin: 0;
640
+ padding: 0;
641
+ }
642
+
607
643
  button,
608
644
  input,
609
645
  optgroup,
@@ -613,9 +649,24 @@ textarea {
613
649
  font-size: 100%;
614
650
  font-weight: inherit;
615
651
  line-height: inherit;
652
+ letter-spacing: inherit;
616
653
  color: inherit;
617
654
  margin: 0;
618
655
  padding: 0;
656
+ background-color: transparent;
657
+ background-image: none;
658
+ }
659
+
660
+ button,
661
+ [type='button'],
662
+ [type='reset'],
663
+ [type='submit'] {
664
+ -webkit-appearance: button;
665
+ cursor: pointer;
666
+ }
667
+
668
+ :disabled {
669
+ cursor: default;
619
670
  }
620
671
 
621
672
  button,
@@ -623,6 +674,28 @@ select {
623
674
  text-transform: none;
624
675
  }
625
676
 
677
+ img,
678
+ svg,
679
+ video,
680
+ canvas,
681
+ audio,
682
+ iframe,
683
+ embed,
684
+ object {
685
+ display: block;
686
+ vertical-align: middle;
687
+ }
688
+
689
+ img,
690
+ video {
691
+ max-width: 100%;
692
+ height: auto;
693
+ }
694
+
695
+ [hidden] {
696
+ display: none;
697
+ }
698
+
626
699
  /* \u2500\u2500 Design tokens \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
627
700
  :root {
628
701
  /* Motion durations */
@@ -820,6 +893,30 @@ select {
820
893
  .alive-loop-ping { animation: alive-ping 1s cubic-bezier(0, 0, 0.2, 1) infinite; }
821
894
  .alive-loop-bounce { animation: alive-bounce 1s infinite; }
822
895
 
896
+ /* \u2500\u2500 Scroll-reveal (data-alive-scroll) \u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500 */
897
+
898
+ [data-alive-scroll] {
899
+ opacity: 0;
900
+ transform: translateY(8px);
901
+ }
902
+ [data-alive-scroll].is-visible {
903
+ animation: alive-fade-up var(--alive-duration-slow) var(--alive-ease-emphasized) both;
904
+ }
905
+ [data-alive-scroll="fade"] {
906
+ opacity: 0;
907
+ transform: none;
908
+ }
909
+ [data-alive-scroll="fade"].is-visible {
910
+ animation: alive-fade-in var(--alive-duration-normal) var(--alive-ease-standard) both;
911
+ }
912
+ [data-alive-scroll="scale"] {
913
+ opacity: 0;
914
+ transform: scale(0.94);
915
+ }
916
+ [data-alive-scroll="scale"].is-visible {
917
+ animation: alive-scale-in var(--alive-duration-slow) var(--alive-ease-emphasized) both;
918
+ }
919
+
823
920
  /* Reduced motion \u2014 respect system preference */
824
921
  @media (prefers-reduced-motion: reduce) {
825
922
  .alive-enter,
@@ -842,6 +939,18 @@ select {
842
939
  transform: none;
843
940
  }
844
941
 
942
+ [data-alive-scroll],
943
+ [data-alive-scroll="fade"],
944
+ [data-alive-scroll="scale"] {
945
+ opacity: 1;
946
+ transform: none;
947
+ }
948
+ [data-alive-scroll].is-visible,
949
+ [data-alive-scroll="fade"].is-visible,
950
+ [data-alive-scroll="scale"].is-visible {
951
+ animation: none;
952
+ }
953
+
845
954
  /* depth system \u2014 disable hover lift and active press */
846
955
  .d2,
847
956
  .d2:hover,
@@ -2193,6 +2302,19 @@ function resolveColor(colors, name, shade) {
2193
2302
  if (!Object.prototype.hasOwnProperty.call(entry, shade)) return null;
2194
2303
  return entry[shade] ?? null;
2195
2304
  }
2305
+ function applyOpacity(value, opacity) {
2306
+ const alpha = +(opacity / 100).toFixed(3);
2307
+ const hexMatch = value.match(/^#([0-9a-fA-F]{3,6})$/);
2308
+ if (hexMatch) {
2309
+ let hex = hexMatch[1];
2310
+ if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
2311
+ const r = parseInt(hex.slice(0, 2), 16);
2312
+ const g = parseInt(hex.slice(2, 4), 16);
2313
+ const b = parseInt(hex.slice(4, 6), 16);
2314
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
2315
+ }
2316
+ return `color-mix(in srgb, ${value} ${opacity}%, transparent)`;
2317
+ }
2196
2318
  function parseVariants(cls) {
2197
2319
  const variants = [];
2198
2320
  let depth = 0;
@@ -2232,7 +2354,7 @@ function matchColor(cls, colors) {
2232
2354
  if (bgMatch) {
2233
2355
  const value = resolveColor(colors, bgMatch[1], bgMatch[2]);
2234
2356
  if (value) {
2235
- return `.${cls} {
2357
+ return `.${escapeSelector(cls)} {
2236
2358
  background-color: ${value};${transitioned("background-color")}
2237
2359
  }`;
2238
2360
  }
@@ -2241,7 +2363,7 @@ function matchColor(cls, colors) {
2241
2363
  if (textColorMatch) {
2242
2364
  const value = resolveColor(colors, textColorMatch[1], textColorMatch[2]);
2243
2365
  if (value) {
2244
- return `.${cls} {
2366
+ return `.${escapeSelector(cls)} {
2245
2367
  color: ${value};${transitioned("color")}
2246
2368
  }`;
2247
2369
  }
@@ -2250,7 +2372,7 @@ function matchColor(cls, colors) {
2250
2372
  if (borderColorMatch) {
2251
2373
  const value = resolveColor(colors, borderColorMatch[1], borderColorMatch[2]);
2252
2374
  if (value) {
2253
- return `.${cls} {
2375
+ return `.${escapeSelector(cls)} {
2254
2376
  border-color: ${value};${transitioned("border-color")}
2255
2377
  }`;
2256
2378
  }
@@ -2259,7 +2381,7 @@ function matchColor(cls, colors) {
2259
2381
  if (ringColorMatch) {
2260
2382
  const value = resolveColor(colors, ringColorMatch[1], ringColorMatch[2]);
2261
2383
  if (value) {
2262
- return `.${cls} {
2384
+ return `.${escapeSelector(cls)} {
2263
2385
  --alive-ring-color: ${value};
2264
2386
  }`;
2265
2387
  }
@@ -2268,7 +2390,7 @@ function matchColor(cls, colors) {
2268
2390
  if (outlineColorMatch) {
2269
2391
  const value = resolveColor(colors, outlineColorMatch[1], outlineColorMatch[2]);
2270
2392
  if (value) {
2271
- return `.${cls} {
2393
+ return `.${escapeSelector(cls)} {
2272
2394
  outline-color: ${value};
2273
2395
  }`;
2274
2396
  }
@@ -2277,7 +2399,7 @@ function matchColor(cls, colors) {
2277
2399
  if (fillMatch) {
2278
2400
  const value = resolveColor(colors, fillMatch[1], fillMatch[2]);
2279
2401
  if (value) {
2280
- return `.${cls} {
2402
+ return `.${escapeSelector(cls)} {
2281
2403
  fill: ${value};
2282
2404
  }`;
2283
2405
  }
@@ -2286,7 +2408,7 @@ function matchColor(cls, colors) {
2286
2408
  if (strokeMatch) {
2287
2409
  const value = resolveColor(colors, strokeMatch[1], strokeMatch[2]);
2288
2410
  if (value) {
2289
- return `.${cls} {
2411
+ return `.${escapeSelector(cls)} {
2290
2412
  stroke: ${value};
2291
2413
  }`;
2292
2414
  }
@@ -2295,7 +2417,7 @@ function matchColor(cls, colors) {
2295
2417
  if (decorationMatch) {
2296
2418
  const value = resolveColor(colors, decorationMatch[1], decorationMatch[2]);
2297
2419
  if (value) {
2298
- return `.${cls} {
2420
+ return `.${escapeSelector(cls)} {
2299
2421
  text-decoration-color: ${value};
2300
2422
  }`;
2301
2423
  }
@@ -2304,7 +2426,7 @@ function matchColor(cls, colors) {
2304
2426
  if (caretMatch) {
2305
2427
  const value = resolveColor(colors, caretMatch[1], caretMatch[2]);
2306
2428
  if (value) {
2307
- return `.${cls} {
2429
+ return `.${escapeSelector(cls)} {
2308
2430
  caret-color: ${value};
2309
2431
  }`;
2310
2432
  }
@@ -2313,7 +2435,7 @@ function matchColor(cls, colors) {
2313
2435
  if (accentMatch) {
2314
2436
  const value = resolveColor(colors, accentMatch[1], accentMatch[2]);
2315
2437
  if (value) {
2316
- return `.${cls} {
2438
+ return `.${escapeSelector(cls)} {
2317
2439
  accent-color: ${value};
2318
2440
  }`;
2319
2441
  }
@@ -2322,49 +2444,72 @@ function matchColor(cls, colors) {
2322
2444
  if (shadowColorMatch) {
2323
2445
  const value = resolveColor(colors, shadowColorMatch[1], shadowColorMatch[2]);
2324
2446
  if (value) {
2325
- return `.${cls} {
2447
+ return `.${escapeSelector(cls)} {
2326
2448
  --alive-shadow-color: ${value};
2327
2449
  }`;
2328
2450
  }
2329
2451
  }
2330
- const arbBgMatch = cls.match(/^bg-\[(.+)\]$/);
2452
+ const arbBgMatch = cls.match(/^bg-\[(.+)\](?:\/(\d+))?$/);
2331
2453
  if (arbBgMatch) {
2332
- const val = arbBgMatch[1];
2454
+ const [, val, opStr] = arbBgMatch;
2333
2455
  const escaped = escapeSelector(cls);
2334
2456
  if (val.startsWith("url(") || val.startsWith("linear-gradient") || val.startsWith("radial-gradient")) {
2335
2457
  return `.${escaped} {
2336
2458
  background-image: ${val};${transitioned("background-image")}
2337
2459
  }`;
2338
2460
  }
2461
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2339
2462
  return `.${escaped} {
2340
- background-color: ${val};${transitioned("background-color")}
2463
+ background-color: ${colorVal};${transitioned("background-color")}
2341
2464
  }`;
2342
2465
  }
2343
- const arbTextMatch = cls.match(/^text-\[(.+)\]$/);
2466
+ const arbTextMatch = cls.match(/^text-\[(.+)\](?:\/(\d+))?$/);
2344
2467
  if (arbTextMatch) {
2468
+ const [, val, opStr] = arbTextMatch;
2469
+ const isSizeValue = val.endsWith("px") || val.endsWith("em") || val.endsWith("rem") || val.endsWith("%") || val.endsWith("vw") || val.endsWith("vh") || val.endsWith("ch") || val.endsWith("ex") || val.endsWith("dvh") || /^[\d.]/.test(val) || /^(calc|clamp|min|max)\(/.test(val);
2470
+ if (isSizeValue) {
2471
+ return `.${escapeSelector(cls)} {
2472
+ font-size: ${val};
2473
+ }`;
2474
+ }
2475
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2345
2476
  return `.${escapeSelector(cls)} {
2346
- color: ${arbTextMatch[1]};${transitioned("color")}
2477
+ color: ${colorVal};${transitioned("color")}
2347
2478
  }`;
2348
2479
  }
2349
- const arbBorderColorMatch = cls.match(/^border-\[#[0-9a-fA-F]|^border-\[rgb|^border-\[hsl|^border-\[oklch/);
2480
+ const arbBorderColorMatch = cls.match(/^border-\[(.+)\](?:\/(\d+))?$/);
2350
2481
  if (arbBorderColorMatch) {
2351
- const m = cls.match(/^border-\[(.+)\]$/);
2352
- if (m) {
2482
+ const [, val, opStr] = arbBorderColorMatch;
2483
+ const looksLikeColor = val.startsWith("#") || val.startsWith("rgb") || val.startsWith("hsl") || val.startsWith("oklch") || val.startsWith("var(") || val === "transparent" || val === "currentColor";
2484
+ if (looksLikeColor) {
2485
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2353
2486
  return `.${escapeSelector(cls)} {
2354
- border-color: ${m[1]};${transitioned("border-color")}
2487
+ border-color: ${colorVal};${transitioned("border-color")}
2355
2488
  }`;
2356
2489
  }
2357
2490
  }
2358
- const arbFillMatch = cls.match(/^fill-\[(.+)\]$/);
2491
+ const arbRingColorMatch = cls.match(/^ring-\[(.+)\](?:\/(\d+))?$/);
2492
+ if (arbRingColorMatch) {
2493
+ const [, val, opStr] = arbRingColorMatch;
2494
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2495
+ return `.${escapeSelector(cls)} {
2496
+ --alive-ring-color: ${colorVal};
2497
+ }`;
2498
+ }
2499
+ const arbFillMatch = cls.match(/^fill-\[(.+)\](?:\/(\d+))?$/);
2359
2500
  if (arbFillMatch) {
2501
+ const [, val, opStr] = arbFillMatch;
2502
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2360
2503
  return `.${escapeSelector(cls)} {
2361
- fill: ${arbFillMatch[1]};
2504
+ fill: ${colorVal};
2362
2505
  }`;
2363
2506
  }
2364
- const arbStrokeMatch = cls.match(/^stroke-\[(.+)\]$/);
2507
+ const arbStrokeMatch = cls.match(/^stroke-\[(.+)\](?:\/(\d+))?$/);
2365
2508
  if (arbStrokeMatch) {
2509
+ const [, val, opStr] = arbStrokeMatch;
2510
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2366
2511
  return `.${escapeSelector(cls)} {
2367
- stroke: ${arbStrokeMatch[1]};
2512
+ stroke: ${colorVal};
2368
2513
  }`;
2369
2514
  }
2370
2515
  return null;
@@ -2386,182 +2531,182 @@ function has(obj, key) {
2386
2531
  function matchSpacing(cls, spacing) {
2387
2532
  const pMatch = cls.match(/^p-(.+)$/);
2388
2533
  if (pMatch && has(spacing, pMatch[1])) {
2389
- return `.${cls} { padding: ${spacing[pMatch[1]]}; }`;
2534
+ return `.${escapeSelector(cls)} { padding: ${spacing[pMatch[1]]}; }`;
2390
2535
  }
2391
2536
  const pxMatch = cls.match(/^px-(.+)$/);
2392
2537
  if (pxMatch && has(spacing, pxMatch[1])) {
2393
- return `.${cls} { padding-left: ${spacing[pxMatch[1]]}; padding-right: ${spacing[pxMatch[1]]}; }`;
2538
+ return `.${escapeSelector(cls)} { padding-left: ${spacing[pxMatch[1]]}; padding-right: ${spacing[pxMatch[1]]}; }`;
2394
2539
  }
2395
2540
  const pyMatch = cls.match(/^py-(.+)$/);
2396
2541
  if (pyMatch && has(spacing, pyMatch[1])) {
2397
- return `.${cls} { padding-top: ${spacing[pyMatch[1]]}; padding-bottom: ${spacing[pyMatch[1]]}; }`;
2542
+ return `.${escapeSelector(cls)} { padding-top: ${spacing[pyMatch[1]]}; padding-bottom: ${spacing[pyMatch[1]]}; }`;
2398
2543
  }
2399
2544
  const ptMatch = cls.match(/^pt-(.+)$/);
2400
2545
  if (ptMatch && has(spacing, ptMatch[1])) {
2401
- return `.${cls} { padding-top: ${spacing[ptMatch[1]]}; }`;
2546
+ return `.${escapeSelector(cls)} { padding-top: ${spacing[ptMatch[1]]}; }`;
2402
2547
  }
2403
2548
  const prMatch = cls.match(/^pr-(.+)$/);
2404
2549
  if (prMatch && has(spacing, prMatch[1])) {
2405
- return `.${cls} { padding-right: ${spacing[prMatch[1]]}; }`;
2550
+ return `.${escapeSelector(cls)} { padding-right: ${spacing[prMatch[1]]}; }`;
2406
2551
  }
2407
2552
  const pbMatch = cls.match(/^pb-(.+)$/);
2408
2553
  if (pbMatch && has(spacing, pbMatch[1])) {
2409
- return `.${cls} { padding-bottom: ${spacing[pbMatch[1]]}; }`;
2554
+ return `.${escapeSelector(cls)} { padding-bottom: ${spacing[pbMatch[1]]}; }`;
2410
2555
  }
2411
2556
  const plMatch = cls.match(/^pl-(.+)$/);
2412
2557
  if (plMatch && has(spacing, plMatch[1])) {
2413
- return `.${cls} { padding-left: ${spacing[plMatch[1]]}; }`;
2558
+ return `.${escapeSelector(cls)} { padding-left: ${spacing[plMatch[1]]}; }`;
2414
2559
  }
2415
2560
  const mMatch = cls.match(/^m-(.+)$/);
2416
2561
  if (mMatch) {
2417
- if (mMatch[1] === "auto") return `.${cls} { margin: auto; }`;
2418
- if (has(spacing, mMatch[1])) return `.${cls} { margin: ${spacing[mMatch[1]]}; }`;
2562
+ if (mMatch[1] === "auto") return `.${escapeSelector(cls)} { margin: auto; }`;
2563
+ if (has(spacing, mMatch[1])) return `.${escapeSelector(cls)} { margin: ${spacing[mMatch[1]]}; }`;
2419
2564
  }
2420
2565
  const mxMatch = cls.match(/^mx-(.+)$/);
2421
2566
  if (mxMatch) {
2422
- if (mxMatch[1] === "auto") return `.${cls} { margin-left: auto; margin-right: auto; }`;
2423
- if (has(spacing, mxMatch[1])) return `.${cls} { margin-left: ${spacing[mxMatch[1]]}; margin-right: ${spacing[mxMatch[1]]}; }`;
2567
+ if (mxMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-left: auto; margin-right: auto; }`;
2568
+ if (has(spacing, mxMatch[1])) return `.${escapeSelector(cls)} { margin-left: ${spacing[mxMatch[1]]}; margin-right: ${spacing[mxMatch[1]]}; }`;
2424
2569
  }
2425
2570
  const myMatch = cls.match(/^my-(.+)$/);
2426
2571
  if (myMatch) {
2427
- if (myMatch[1] === "auto") return `.${cls} { margin-top: auto; margin-bottom: auto; }`;
2428
- if (has(spacing, myMatch[1])) return `.${cls} { margin-top: ${spacing[myMatch[1]]}; margin-bottom: ${spacing[myMatch[1]]}; }`;
2572
+ if (myMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-top: auto; margin-bottom: auto; }`;
2573
+ if (has(spacing, myMatch[1])) return `.${escapeSelector(cls)} { margin-top: ${spacing[myMatch[1]]}; margin-bottom: ${spacing[myMatch[1]]}; }`;
2429
2574
  }
2430
2575
  const mtMatch = cls.match(/^mt-(.+)$/);
2431
2576
  if (mtMatch) {
2432
- if (mtMatch[1] === "auto") return `.${cls} { margin-top: auto; }`;
2433
- if (has(spacing, mtMatch[1])) return `.${cls} { margin-top: ${spacing[mtMatch[1]]}; }`;
2577
+ if (mtMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-top: auto; }`;
2578
+ if (has(spacing, mtMatch[1])) return `.${escapeSelector(cls)} { margin-top: ${spacing[mtMatch[1]]}; }`;
2434
2579
  }
2435
2580
  const mrMatch = cls.match(/^mr-(.+)$/);
2436
2581
  if (mrMatch) {
2437
- if (mrMatch[1] === "auto") return `.${cls} { margin-right: auto; }`;
2438
- if (has(spacing, mrMatch[1])) return `.${cls} { margin-right: ${spacing[mrMatch[1]]}; }`;
2582
+ if (mrMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-right: auto; }`;
2583
+ if (has(spacing, mrMatch[1])) return `.${escapeSelector(cls)} { margin-right: ${spacing[mrMatch[1]]}; }`;
2439
2584
  }
2440
2585
  const mbMatch = cls.match(/^mb-(.+)$/);
2441
2586
  if (mbMatch) {
2442
- if (mbMatch[1] === "auto") return `.${cls} { margin-bottom: auto; }`;
2443
- if (has(spacing, mbMatch[1])) return `.${cls} { margin-bottom: ${spacing[mbMatch[1]]}; }`;
2587
+ if (mbMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-bottom: auto; }`;
2588
+ if (has(spacing, mbMatch[1])) return `.${escapeSelector(cls)} { margin-bottom: ${spacing[mbMatch[1]]}; }`;
2444
2589
  }
2445
2590
  const mlMatch = cls.match(/^ml-(.+)$/);
2446
2591
  if (mlMatch) {
2447
- if (mlMatch[1] === "auto") return `.${cls} { margin-left: auto; }`;
2448
- if (has(spacing, mlMatch[1])) return `.${cls} { margin-left: ${spacing[mlMatch[1]]}; }`;
2592
+ if (mlMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-left: auto; }`;
2593
+ if (has(spacing, mlMatch[1])) return `.${escapeSelector(cls)} { margin-left: ${spacing[mlMatch[1]]}; }`;
2449
2594
  }
2450
2595
  const gapMatch = cls.match(/^gap-(.+)$/);
2451
2596
  if (gapMatch && has(spacing, gapMatch[1])) {
2452
- return `.${cls} { gap: ${spacing[gapMatch[1]]}; }`;
2597
+ return `.${escapeSelector(cls)} { gap: ${spacing[gapMatch[1]]}; }`;
2453
2598
  }
2454
2599
  const gapXMatch = cls.match(/^gap-x-(.+)$/);
2455
2600
  if (gapXMatch && has(spacing, gapXMatch[1])) {
2456
- return `.${cls} { column-gap: ${spacing[gapXMatch[1]]}; }`;
2601
+ return `.${escapeSelector(cls)} { column-gap: ${spacing[gapXMatch[1]]}; }`;
2457
2602
  }
2458
2603
  const gapYMatch = cls.match(/^gap-y-(.+)$/);
2459
2604
  if (gapYMatch && has(spacing, gapYMatch[1])) {
2460
- return `.${cls} { row-gap: ${spacing[gapYMatch[1]]}; }`;
2605
+ return `.${escapeSelector(cls)} { row-gap: ${spacing[gapYMatch[1]]}; }`;
2461
2606
  }
2462
2607
  const spaceXMatch = cls.match(/^space-x-(.+)$/);
2463
2608
  if (spaceXMatch && has(spacing, spaceXMatch[1])) {
2464
- return `.${cls} > * + * { margin-left: ${spacing[spaceXMatch[1]]}; }`;
2609
+ return `.${escapeSelector(cls)}> * + * { margin-left: ${spacing[spaceXMatch[1]]}; }`;
2465
2610
  }
2466
2611
  const spaceYMatch = cls.match(/^space-y-(.+)$/);
2467
2612
  if (spaceYMatch && has(spacing, spaceYMatch[1])) {
2468
- return `.${cls} > * + * { margin-top: ${spacing[spaceYMatch[1]]}; }`;
2613
+ return `.${escapeSelector(cls)}> * + * { margin-top: ${spacing[spaceYMatch[1]]}; }`;
2469
2614
  }
2470
2615
  const insetMatch = cls.match(/^inset-(.+)$/);
2471
2616
  if (insetMatch) {
2472
- if (insetMatch[1] === "auto") return `.${cls} { inset: auto; }`;
2473
- if (insetMatch[1] === "0") return `.${cls} { inset: 0px; }`;
2474
- if (has(spacing, insetMatch[1])) return `.${cls} { inset: ${spacing[insetMatch[1]]}; }`;
2617
+ if (insetMatch[1] === "auto") return `.${escapeSelector(cls)} { inset: auto; }`;
2618
+ if (insetMatch[1] === "0") return `.${escapeSelector(cls)} { inset: 0px; }`;
2619
+ if (has(spacing, insetMatch[1])) return `.${escapeSelector(cls)} { inset: ${spacing[insetMatch[1]]}; }`;
2475
2620
  }
2476
2621
  const insetXMatch = cls.match(/^inset-x-(.+)$/);
2477
2622
  if (insetXMatch) {
2478
2623
  const val = insetXMatch[1] === "auto" ? "auto" : insetXMatch[1] === "0" ? "0px" : has(spacing, insetXMatch[1]) ? spacing[insetXMatch[1]] : void 0;
2479
- if (val) return `.${cls} { left: ${val}; right: ${val}; }`;
2624
+ if (val) return `.${escapeSelector(cls)} { left: ${val}; right: ${val}; }`;
2480
2625
  }
2481
2626
  const insetYMatch = cls.match(/^inset-y-(.+)$/);
2482
2627
  if (insetYMatch) {
2483
2628
  const val = insetYMatch[1] === "auto" ? "auto" : insetYMatch[1] === "0" ? "0px" : has(spacing, insetYMatch[1]) ? spacing[insetYMatch[1]] : void 0;
2484
- if (val) return `.${cls} { top: ${val}; bottom: ${val}; }`;
2629
+ if (val) return `.${escapeSelector(cls)} { top: ${val}; bottom: ${val}; }`;
2485
2630
  }
2486
2631
  const topMatch = cls.match(/^top-(.+)$/);
2487
2632
  if (topMatch) {
2488
- if (topMatch[1] === "auto") return `.${cls} { top: auto; }`;
2489
- if (topMatch[1] === "0") return `.${cls} { top: 0px; }`;
2490
- if (has(spacing, topMatch[1])) return `.${cls} { top: ${spacing[topMatch[1]]}; }`;
2633
+ if (topMatch[1] === "auto") return `.${escapeSelector(cls)} { top: auto; }`;
2634
+ if (topMatch[1] === "0") return `.${escapeSelector(cls)} { top: 0px; }`;
2635
+ if (has(spacing, topMatch[1])) return `.${escapeSelector(cls)} { top: ${spacing[topMatch[1]]}; }`;
2491
2636
  }
2492
2637
  const rightMatch = cls.match(/^right-(.+)$/);
2493
2638
  if (rightMatch) {
2494
- if (rightMatch[1] === "auto") return `.${cls} { right: auto; }`;
2495
- if (rightMatch[1] === "0") return `.${cls} { right: 0px; }`;
2496
- if (has(spacing, rightMatch[1])) return `.${cls} { right: ${spacing[rightMatch[1]]}; }`;
2639
+ if (rightMatch[1] === "auto") return `.${escapeSelector(cls)} { right: auto; }`;
2640
+ if (rightMatch[1] === "0") return `.${escapeSelector(cls)} { right: 0px; }`;
2641
+ if (has(spacing, rightMatch[1])) return `.${escapeSelector(cls)} { right: ${spacing[rightMatch[1]]}; }`;
2497
2642
  }
2498
2643
  const bottomMatch = cls.match(/^bottom-(.+)$/);
2499
2644
  if (bottomMatch) {
2500
- if (bottomMatch[1] === "auto") return `.${cls} { bottom: auto; }`;
2501
- if (bottomMatch[1] === "0") return `.${cls} { bottom: 0px; }`;
2502
- if (has(spacing, bottomMatch[1])) return `.${cls} { bottom: ${spacing[bottomMatch[1]]}; }`;
2645
+ if (bottomMatch[1] === "auto") return `.${escapeSelector(cls)} { bottom: auto; }`;
2646
+ if (bottomMatch[1] === "0") return `.${escapeSelector(cls)} { bottom: 0px; }`;
2647
+ if (has(spacing, bottomMatch[1])) return `.${escapeSelector(cls)} { bottom: ${spacing[bottomMatch[1]]}; }`;
2503
2648
  }
2504
2649
  const leftMatch = cls.match(/^left-(.+)$/);
2505
2650
  if (leftMatch) {
2506
- if (leftMatch[1] === "auto") return `.${cls} { left: auto; }`;
2507
- if (leftMatch[1] === "0") return `.${cls} { left: 0px; }`;
2508
- if (has(spacing, leftMatch[1])) return `.${cls} { left: ${spacing[leftMatch[1]]}; }`;
2651
+ if (leftMatch[1] === "auto") return `.${escapeSelector(cls)} { left: auto; }`;
2652
+ if (leftMatch[1] === "0") return `.${escapeSelector(cls)} { left: 0px; }`;
2653
+ if (has(spacing, leftMatch[1])) return `.${escapeSelector(cls)} { left: ${spacing[leftMatch[1]]}; }`;
2509
2654
  }
2510
2655
  const negMMatch = cls.match(/^-m-(.+)$/);
2511
2656
  if (negMMatch && has(spacing, negMMatch[1])) {
2512
- return `.\\-m-${negMMatch[1]} { margin: -${spacing[negMMatch[1]]}; }`;
2657
+ return `.${escapeSelector(cls)} { margin: -${spacing[negMMatch[1]]}; }`;
2513
2658
  }
2514
2659
  const negMxMatch = cls.match(/^-mx-(.+)$/);
2515
2660
  if (negMxMatch && has(spacing, negMxMatch[1])) {
2516
- return `.\\-mx-${negMxMatch[1]} { margin-left: -${spacing[negMxMatch[1]]}; margin-right: -${spacing[negMxMatch[1]]}; }`;
2661
+ return `.${escapeSelector(cls)} { margin-left: -${spacing[negMxMatch[1]]}; margin-right: -${spacing[negMxMatch[1]]}; }`;
2517
2662
  }
2518
2663
  const negMyMatch = cls.match(/^-my-(.+)$/);
2519
2664
  if (negMyMatch && has(spacing, negMyMatch[1])) {
2520
- return `.\\-my-${negMyMatch[1]} { margin-top: -${spacing[negMyMatch[1]]}; margin-bottom: -${spacing[negMyMatch[1]]}; }`;
2665
+ return `.${escapeSelector(cls)} { margin-top: -${spacing[negMyMatch[1]]}; margin-bottom: -${spacing[negMyMatch[1]]}; }`;
2521
2666
  }
2522
2667
  const negMtMatch = cls.match(/^-mt-(.+)$/);
2523
2668
  if (negMtMatch && has(spacing, negMtMatch[1])) {
2524
- return `.\\-mt-${negMtMatch[1]} { margin-top: -${spacing[negMtMatch[1]]}; }`;
2669
+ return `.${escapeSelector(cls)} { margin-top: -${spacing[negMtMatch[1]]}; }`;
2525
2670
  }
2526
2671
  const negMrMatch = cls.match(/^-mr-(.+)$/);
2527
2672
  if (negMrMatch && has(spacing, negMrMatch[1])) {
2528
- return `.\\-mr-${negMrMatch[1]} { margin-right: -${spacing[negMrMatch[1]]}; }`;
2673
+ return `.${escapeSelector(cls)} { margin-right: -${spacing[negMrMatch[1]]}; }`;
2529
2674
  }
2530
2675
  const negMbMatch = cls.match(/^-mb-(.+)$/);
2531
2676
  if (negMbMatch && has(spacing, negMbMatch[1])) {
2532
- return `.\\-mb-${negMbMatch[1]} { margin-bottom: -${spacing[negMbMatch[1]]}; }`;
2677
+ return `.${escapeSelector(cls)} { margin-bottom: -${spacing[negMbMatch[1]]}; }`;
2533
2678
  }
2534
2679
  const negMlMatch = cls.match(/^-ml-(.+)$/);
2535
2680
  if (negMlMatch && has(spacing, negMlMatch[1])) {
2536
- return `.\\-ml-${negMlMatch[1]} { margin-left: -${spacing[negMlMatch[1]]}; }`;
2681
+ return `.${escapeSelector(cls)} { margin-left: -${spacing[negMlMatch[1]]}; }`;
2537
2682
  }
2538
2683
  const negInsetMatch = cls.match(/^-inset-(.+)$/);
2539
2684
  if (negInsetMatch && has(spacing, negInsetMatch[1])) {
2540
- return `.\\-inset-${negInsetMatch[1]} { inset: -${spacing[negInsetMatch[1]]}; }`;
2685
+ return `.${escapeSelector(cls)} { inset: -${spacing[negInsetMatch[1]]}; }`;
2541
2686
  }
2542
2687
  const negInsetXMatch = cls.match(/^-inset-x-(.+)$/);
2543
2688
  if (negInsetXMatch && has(spacing, negInsetXMatch[1])) {
2544
- return `.\\-inset-x-${negInsetXMatch[1]} { left: -${spacing[negInsetXMatch[1]]}; right: -${spacing[negInsetXMatch[1]]}; }`;
2689
+ return `.${escapeSelector(cls)} { left: -${spacing[negInsetXMatch[1]]}; right: -${spacing[negInsetXMatch[1]]}; }`;
2545
2690
  }
2546
2691
  const negInsetYMatch = cls.match(/^-inset-y-(.+)$/);
2547
2692
  if (negInsetYMatch && has(spacing, negInsetYMatch[1])) {
2548
- return `.\\-inset-y-${negInsetYMatch[1]} { top: -${spacing[negInsetYMatch[1]]}; bottom: -${spacing[negInsetYMatch[1]]}; }`;
2693
+ return `.${escapeSelector(cls)} { top: -${spacing[negInsetYMatch[1]]}; bottom: -${spacing[negInsetYMatch[1]]}; }`;
2549
2694
  }
2550
2695
  const negTopMatch = cls.match(/^-top-(.+)$/);
2551
2696
  if (negTopMatch && has(spacing, negTopMatch[1])) {
2552
- return `.\\-top-${negTopMatch[1]} { top: -${spacing[negTopMatch[1]]}; }`;
2697
+ return `.${escapeSelector(cls)} { top: -${spacing[negTopMatch[1]]}; }`;
2553
2698
  }
2554
2699
  const negRightMatch = cls.match(/^-right-(.+)$/);
2555
2700
  if (negRightMatch && has(spacing, negRightMatch[1])) {
2556
- return `.\\-right-${negRightMatch[1]} { right: -${spacing[negRightMatch[1]]}; }`;
2701
+ return `.${escapeSelector(cls)} { right: -${spacing[negRightMatch[1]]}; }`;
2557
2702
  }
2558
2703
  const negBottomMatch = cls.match(/^-bottom-(.+)$/);
2559
2704
  if (negBottomMatch && has(spacing, negBottomMatch[1])) {
2560
- return `.\\-bottom-${negBottomMatch[1]} { bottom: -${spacing[negBottomMatch[1]]}; }`;
2705
+ return `.${escapeSelector(cls)} { bottom: -${spacing[negBottomMatch[1]]}; }`;
2561
2706
  }
2562
2707
  const negLeftMatch = cls.match(/^-left-(.+)$/);
2563
2708
  if (negLeftMatch && has(spacing, negLeftMatch[1])) {
2564
- return `.\\-left-${negLeftMatch[1]} { left: -${spacing[negLeftMatch[1]]}; }`;
2709
+ return `.${escapeSelector(cls)} { left: -${spacing[negLeftMatch[1]]}; }`;
2565
2710
  }
2566
2711
  const arbSpacingMatch = cls.match(/^(w|h|p|m|pt|pr|pb|pl|px|py|mt|mr|mb|ml|mx|my|gap|gap-x|gap-y|top|right|bottom|left|inset|inset-x|inset-y)-\[(.+)\]$/);
2567
2712
  if (arbSpacingMatch) {
@@ -2642,21 +2787,21 @@ function matchTypography(cls, fontSize, fontWeight, lineHeight) {
2642
2787
  const textSizeMatch = cls.match(/^text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/);
2643
2788
  if (textSizeMatch && hasOwn(fontSize, textSizeMatch[1])) {
2644
2789
  const [size, lh] = fontSize[textSizeMatch[1]];
2645
- return `.${cls} {
2790
+ return `.${escapeSelector(cls)} {
2646
2791
  font-size: ${size};
2647
2792
  line-height: ${lh};
2648
2793
  }`;
2649
2794
  }
2650
2795
  const fontWeightMatch = cls.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)$/);
2651
2796
  if (fontWeightMatch && hasOwn(fontWeight, fontWeightMatch[1])) {
2652
- return `.${cls} { font-weight: ${fontWeight[fontWeightMatch[1]]}; }`;
2797
+ return `.${escapeSelector(cls)} { font-weight: ${fontWeight[fontWeightMatch[1]]}; }`;
2653
2798
  }
2654
- if (cls === "font-sans") return `.${cls} { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }`;
2655
- if (cls === "font-serif") return `.${cls} { font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; }`;
2656
- if (cls === "font-mono") return `.${cls} { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }`;
2799
+ if (cls === "font-sans") return `.${escapeSelector(cls)} { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }`;
2800
+ if (cls === "font-serif") return `.${escapeSelector(cls)} { font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; }`;
2801
+ if (cls === "font-mono") return `.${escapeSelector(cls)} { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }`;
2657
2802
  const leadingMatch = cls.match(/^leading-(.+)$/);
2658
2803
  if (leadingMatch && hasOwn(lineHeight, leadingMatch[1])) {
2659
- return `.${cls} { line-height: ${lineHeight[leadingMatch[1]]}; }`;
2804
+ return `.${escapeSelector(cls)} { line-height: ${lineHeight[leadingMatch[1]]}; }`;
2660
2805
  }
2661
2806
  const trackingMap = {
2662
2807
  tighter: "-0.05em",
@@ -2668,63 +2813,49 @@ function matchTypography(cls, fontSize, fontWeight, lineHeight) {
2668
2813
  };
2669
2814
  const trackingMatch = cls.match(/^tracking-(.+)$/);
2670
2815
  if (trackingMatch && Object.prototype.hasOwnProperty.call(trackingMap, trackingMatch[1])) {
2671
- return `.${cls} { letter-spacing: ${trackingMap[trackingMatch[1]]}; }`;
2672
- }
2673
- if (cls === "text-left") return `.${cls} { text-align: left; }`;
2674
- if (cls === "text-center") return `.${cls} { text-align: center; }`;
2675
- if (cls === "text-right") return `.${cls} { text-align: right; }`;
2676
- if (cls === "text-justify") return `.${cls} { text-align: justify; }`;
2677
- if (cls === "text-start") return `.${cls} { text-align: start; }`;
2678
- if (cls === "text-end") return `.${cls} { text-align: end; }`;
2679
- if (cls === "uppercase") return `.${cls} { text-transform: uppercase; }`;
2680
- if (cls === "lowercase") return `.${cls} { text-transform: lowercase; }`;
2681
- if (cls === "capitalize") return `.${cls} { text-transform: capitalize; }`;
2682
- if (cls === "normal-case") return `.${cls} { text-transform: none; }`;
2683
- if (cls === "underline") return `.${cls} { text-decoration-line: underline; }`;
2684
- if (cls === "overline") return `.${cls} { text-decoration-line: overline; }`;
2685
- if (cls === "line-through") return `.${cls} { text-decoration-line: line-through; }`;
2686
- if (cls === "no-underline") return `.${cls} { text-decoration-line: none; }`;
2687
- if (cls === "truncate") return `.${cls} { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }`;
2688
- if (cls === "text-ellipsis") return `.${cls} { text-overflow: ellipsis; }`;
2689
- if (cls === "text-clip") return `.${cls} { text-overflow: clip; }`;
2690
- if (cls === "whitespace-normal") return `.${cls} { white-space: normal; }`;
2691
- if (cls === "whitespace-nowrap") return `.${cls} { white-space: nowrap; }`;
2692
- if (cls === "whitespace-pre") return `.${cls} { white-space: pre; }`;
2693
- if (cls === "whitespace-pre-line") return `.${cls} { white-space: pre-line; }`;
2694
- if (cls === "whitespace-pre-wrap") return `.${cls} { white-space: pre-wrap; }`;
2695
- if (cls === "whitespace-break-spaces") return `.${cls} { white-space: break-spaces; }`;
2696
- if (cls === "italic") return `.${cls} { font-style: italic; }`;
2697
- if (cls === "not-italic") return `.${cls} { font-style: normal; }`;
2698
- if (cls === "tabular-nums") return `.${cls} { font-variant-numeric: tabular-nums; }`;
2699
- if (cls === "oldstyle-nums") return `.${cls} { font-variant-numeric: oldstyle-nums; }`;
2700
- if (cls === "list-none") return `.${cls} { list-style-type: none; }`;
2701
- if (cls === "list-disc") return `.${cls} { list-style-type: disc; }`;
2702
- if (cls === "list-decimal") return `.${cls} { list-style-type: decimal; }`;
2703
- if (cls === "break-normal") return `.${cls} { overflow-wrap: normal; word-break: normal; }`;
2704
- if (cls === "break-words") return `.${cls} { overflow-wrap: break-word; }`;
2705
- if (cls === "break-all") return `.${cls} { word-break: break-all; }`;
2706
- if (cls === "break-keep") return `.${cls} { word-break: keep-all; }`;
2816
+ return `.${escapeSelector(cls)} { letter-spacing: ${trackingMap[trackingMatch[1]]}; }`;
2817
+ }
2818
+ if (cls === "text-left") return `.${escapeSelector(cls)} { text-align: left; }`;
2819
+ if (cls === "text-center") return `.${escapeSelector(cls)} { text-align: center; }`;
2820
+ if (cls === "text-right") return `.${escapeSelector(cls)} { text-align: right; }`;
2821
+ if (cls === "text-justify") return `.${escapeSelector(cls)} { text-align: justify; }`;
2822
+ if (cls === "text-start") return `.${escapeSelector(cls)} { text-align: start; }`;
2823
+ if (cls === "text-end") return `.${escapeSelector(cls)} { text-align: end; }`;
2824
+ if (cls === "uppercase") return `.${escapeSelector(cls)} { text-transform: uppercase; }`;
2825
+ if (cls === "lowercase") return `.${escapeSelector(cls)} { text-transform: lowercase; }`;
2826
+ if (cls === "capitalize") return `.${escapeSelector(cls)} { text-transform: capitalize; }`;
2827
+ if (cls === "normal-case") return `.${escapeSelector(cls)} { text-transform: none; }`;
2828
+ if (cls === "underline") return `.${escapeSelector(cls)} { text-decoration-line: underline; }`;
2829
+ if (cls === "overline") return `.${escapeSelector(cls)} { text-decoration-line: overline; }`;
2830
+ if (cls === "line-through") return `.${escapeSelector(cls)} { text-decoration-line: line-through; }`;
2831
+ if (cls === "no-underline") return `.${escapeSelector(cls)} { text-decoration-line: none; }`;
2832
+ if (cls === "truncate") return `.${escapeSelector(cls)} { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }`;
2833
+ if (cls === "text-ellipsis") return `.${escapeSelector(cls)} { text-overflow: ellipsis; }`;
2834
+ if (cls === "text-clip") return `.${escapeSelector(cls)} { text-overflow: clip; }`;
2835
+ if (cls === "whitespace-normal") return `.${escapeSelector(cls)} { white-space: normal; }`;
2836
+ if (cls === "whitespace-nowrap") return `.${escapeSelector(cls)} { white-space: nowrap; }`;
2837
+ if (cls === "whitespace-pre") return `.${escapeSelector(cls)} { white-space: pre; }`;
2838
+ if (cls === "whitespace-pre-line") return `.${escapeSelector(cls)} { white-space: pre-line; }`;
2839
+ if (cls === "whitespace-pre-wrap") return `.${escapeSelector(cls)} { white-space: pre-wrap; }`;
2840
+ if (cls === "whitespace-break-spaces") return `.${escapeSelector(cls)} { white-space: break-spaces; }`;
2841
+ if (cls === "italic") return `.${escapeSelector(cls)} { font-style: italic; }`;
2842
+ if (cls === "not-italic") return `.${escapeSelector(cls)} { font-style: normal; }`;
2843
+ if (cls === "tabular-nums") return `.${escapeSelector(cls)} { font-variant-numeric: tabular-nums; }`;
2844
+ if (cls === "oldstyle-nums") return `.${escapeSelector(cls)} { font-variant-numeric: oldstyle-nums; }`;
2845
+ if (cls === "list-none") return `.${escapeSelector(cls)} { list-style-type: none; }`;
2846
+ if (cls === "list-disc") return `.${escapeSelector(cls)} { list-style-type: disc; }`;
2847
+ if (cls === "list-decimal") return `.${escapeSelector(cls)} { list-style-type: decimal; }`;
2848
+ if (cls === "break-normal") return `.${escapeSelector(cls)} { overflow-wrap: normal; word-break: normal; }`;
2849
+ if (cls === "break-words") return `.${escapeSelector(cls)} { overflow-wrap: break-word; }`;
2850
+ if (cls === "break-all") return `.${escapeSelector(cls)} { word-break: break-all; }`;
2851
+ if (cls === "break-keep") return `.${escapeSelector(cls)} { word-break: keep-all; }`;
2707
2852
  return null;
2708
2853
  }
2709
2854
 
2710
2855
  // src/generator/layout.ts
2711
- function has2(obj, key) {
2712
- return typeof obj[key] === "string";
2713
- }
2714
- function generateLayout(classes, config) {
2715
- const { spacing } = config.theme;
2856
+ function generateLayout(classes, _config) {
2716
2857
  const rules = [];
2717
2858
  for (const cls of classes) {
2718
- const spaceYMatch = cls.match(/^space-y-(.+)$/);
2719
- if (spaceYMatch && has2(spacing, spaceYMatch[1])) {
2720
- rules.push(`.${escapeSelector(cls)} > * + * { margin-top: ${spacing[spaceYMatch[1]]}; }`);
2721
- continue;
2722
- }
2723
- const spaceXMatch = cls.match(/^space-x-(.+)$/);
2724
- if (spaceXMatch && has2(spacing, spaceXMatch[1])) {
2725
- rules.push(`.${escapeSelector(cls)} > * + * { margin-left: ${spacing[spaceXMatch[1]]}; }`);
2726
- continue;
2727
- }
2728
2859
  const generated = matchLayout(cls);
2729
2860
  if (generated) rules.push(generated);
2730
2861
  }
@@ -2743,7 +2874,7 @@ function matchLayout(cls) {
2743
2874
  hidden: "display: none;",
2744
2875
  contents: "display: contents;"
2745
2876
  };
2746
- if (displayMap[cls]) return `.${cls} { ${displayMap[cls]} }`;
2877
+ if (displayMap[cls]) return `.${escapeSelector(cls)} { ${displayMap[cls]} }`;
2747
2878
  const posMap = {
2748
2879
  static: "position: static;",
2749
2880
  relative: "position: relative;",
@@ -2751,115 +2882,115 @@ function matchLayout(cls) {
2751
2882
  fixed: "position: fixed;",
2752
2883
  sticky: "position: sticky;"
2753
2884
  };
2754
- if (posMap[cls]) return `.${cls} { ${posMap[cls]} }`;
2755
- if (cls === "flex-row") return `.${cls} { flex-direction: row; }`;
2756
- if (cls === "flex-row-reverse") return `.${cls} { flex-direction: row-reverse; }`;
2757
- if (cls === "flex-col") return `.${cls} { flex-direction: column; }`;
2758
- if (cls === "flex-col-reverse") return `.${cls} { flex-direction: column-reverse; }`;
2759
- if (cls === "flex-wrap") return `.${cls} { flex-wrap: wrap; }`;
2760
- if (cls === "flex-nowrap") return `.${cls} { flex-wrap: nowrap; }`;
2761
- if (cls === "flex-wrap-reverse") return `.${cls} { flex-wrap: wrap-reverse; }`;
2762
- if (cls === "flex-1") return `.${cls} { flex: 1 1 0%; }`;
2763
- if (cls === "flex-auto") return `.${cls} { flex: 1 1 auto; }`;
2764
- if (cls === "flex-initial") return `.${cls} { flex: 0 1 auto; }`;
2765
- if (cls === "flex-none") return `.${cls} { flex: none; }`;
2766
- if (cls === "flex-grow") return `.${cls} { flex-grow: 1; }`;
2767
- if (cls === "flex-grow-0") return `.${cls} { flex-grow: 0; }`;
2768
- if (cls === "flex-shrink") return `.${cls} { flex-shrink: 1; }`;
2769
- if (cls === "flex-shrink-0") return `.${cls} { flex-shrink: 0; }`;
2770
- if (cls === "grow") return `.${cls} { flex-grow: 1; }`;
2771
- if (cls === "grow-0") return `.${cls} { flex-grow: 0; }`;
2772
- if (cls === "shrink") return `.${cls} { flex-shrink: 1; }`;
2773
- if (cls === "shrink-0") return `.${cls} { flex-shrink: 0; }`;
2774
- if (cls === "items-start") return `.${cls} { align-items: flex-start; }`;
2775
- if (cls === "items-end") return `.${cls} { align-items: flex-end; }`;
2776
- if (cls === "items-center") return `.${cls} { align-items: center; }`;
2777
- if (cls === "items-baseline") return `.${cls} { align-items: baseline; }`;
2778
- if (cls === "items-stretch") return `.${cls} { align-items: stretch; }`;
2779
- if (cls === "self-auto") return `.${cls} { align-self: auto; }`;
2780
- if (cls === "self-start") return `.${cls} { align-self: flex-start; }`;
2781
- if (cls === "self-end") return `.${cls} { align-self: flex-end; }`;
2782
- if (cls === "self-center") return `.${cls} { align-self: center; }`;
2783
- if (cls === "self-stretch") return `.${cls} { align-self: stretch; }`;
2784
- if (cls === "self-baseline") return `.${cls} { align-self: baseline; }`;
2785
- if (cls === "justify-start") return `.${cls} { justify-content: flex-start; }`;
2786
- if (cls === "justify-end") return `.${cls} { justify-content: flex-end; }`;
2787
- if (cls === "justify-center") return `.${cls} { justify-content: center; }`;
2788
- if (cls === "justify-between") return `.${cls} { justify-content: space-between; }`;
2789
- if (cls === "justify-around") return `.${cls} { justify-content: space-around; }`;
2790
- if (cls === "justify-evenly") return `.${cls} { justify-content: space-evenly; }`;
2791
- if (cls === "justify-stretch") return `.${cls} { justify-content: stretch; }`;
2792
- if (cls === "justify-items-start") return `.${cls} { justify-items: start; }`;
2793
- if (cls === "justify-items-end") return `.${cls} { justify-items: end; }`;
2794
- if (cls === "justify-items-center") return `.${cls} { justify-items: center; }`;
2795
- if (cls === "justify-items-stretch") return `.${cls} { justify-items: stretch; }`;
2796
- if (cls === "justify-self-auto") return `.${cls} { justify-self: auto; }`;
2797
- if (cls === "justify-self-start") return `.${cls} { justify-self: start; }`;
2798
- if (cls === "justify-self-end") return `.${cls} { justify-self: end; }`;
2799
- if (cls === "justify-self-center") return `.${cls} { justify-self: center; }`;
2800
- if (cls === "justify-self-stretch") return `.${cls} { justify-self: stretch; }`;
2801
- if (cls === "content-normal") return `.${cls} { align-content: normal; }`;
2802
- if (cls === "content-center") return `.${cls} { align-content: center; }`;
2803
- if (cls === "content-start") return `.${cls} { align-content: flex-start; }`;
2804
- if (cls === "content-end") return `.${cls} { align-content: flex-end; }`;
2805
- if (cls === "content-between") return `.${cls} { align-content: space-between; }`;
2806
- if (cls === "content-around") return `.${cls} { align-content: space-around; }`;
2807
- if (cls === "content-evenly") return `.${cls} { align-content: space-evenly; }`;
2808
- if (cls === "content-stretch") return `.${cls} { align-content: stretch; }`;
2809
- if (cls === "content-baseline") return `.${cls} { align-content: baseline; }`;
2885
+ if (posMap[cls]) return `.${escapeSelector(cls)} { ${posMap[cls]} }`;
2886
+ if (cls === "flex-row") return `.${escapeSelector(cls)} { flex-direction: row; }`;
2887
+ if (cls === "flex-row-reverse") return `.${escapeSelector(cls)} { flex-direction: row-reverse; }`;
2888
+ if (cls === "flex-col") return `.${escapeSelector(cls)} { flex-direction: column; }`;
2889
+ if (cls === "flex-col-reverse") return `.${escapeSelector(cls)} { flex-direction: column-reverse; }`;
2890
+ if (cls === "flex-wrap") return `.${escapeSelector(cls)} { flex-wrap: wrap; }`;
2891
+ if (cls === "flex-nowrap") return `.${escapeSelector(cls)} { flex-wrap: nowrap; }`;
2892
+ if (cls === "flex-wrap-reverse") return `.${escapeSelector(cls)} { flex-wrap: wrap-reverse; }`;
2893
+ if (cls === "flex-1") return `.${escapeSelector(cls)} { flex: 1 1 0%; }`;
2894
+ if (cls === "flex-auto") return `.${escapeSelector(cls)} { flex: 1 1 auto; }`;
2895
+ if (cls === "flex-initial") return `.${escapeSelector(cls)} { flex: 0 1 auto; }`;
2896
+ if (cls === "flex-none") return `.${escapeSelector(cls)} { flex: none; }`;
2897
+ if (cls === "flex-grow") return `.${escapeSelector(cls)} { flex-grow: 1; }`;
2898
+ if (cls === "flex-grow-0") return `.${escapeSelector(cls)} { flex-grow: 0; }`;
2899
+ if (cls === "flex-shrink") return `.${escapeSelector(cls)} { flex-shrink: 1; }`;
2900
+ if (cls === "flex-shrink-0") return `.${escapeSelector(cls)} { flex-shrink: 0; }`;
2901
+ if (cls === "grow") return `.${escapeSelector(cls)} { flex-grow: 1; }`;
2902
+ if (cls === "grow-0") return `.${escapeSelector(cls)} { flex-grow: 0; }`;
2903
+ if (cls === "shrink") return `.${escapeSelector(cls)} { flex-shrink: 1; }`;
2904
+ if (cls === "shrink-0") return `.${escapeSelector(cls)} { flex-shrink: 0; }`;
2905
+ if (cls === "items-start") return `.${escapeSelector(cls)} { align-items: flex-start; }`;
2906
+ if (cls === "items-end") return `.${escapeSelector(cls)} { align-items: flex-end; }`;
2907
+ if (cls === "items-center") return `.${escapeSelector(cls)} { align-items: center; }`;
2908
+ if (cls === "items-baseline") return `.${escapeSelector(cls)} { align-items: baseline; }`;
2909
+ if (cls === "items-stretch") return `.${escapeSelector(cls)} { align-items: stretch; }`;
2910
+ if (cls === "self-auto") return `.${escapeSelector(cls)} { align-self: auto; }`;
2911
+ if (cls === "self-start") return `.${escapeSelector(cls)} { align-self: flex-start; }`;
2912
+ if (cls === "self-end") return `.${escapeSelector(cls)} { align-self: flex-end; }`;
2913
+ if (cls === "self-center") return `.${escapeSelector(cls)} { align-self: center; }`;
2914
+ if (cls === "self-stretch") return `.${escapeSelector(cls)} { align-self: stretch; }`;
2915
+ if (cls === "self-baseline") return `.${escapeSelector(cls)} { align-self: baseline; }`;
2916
+ if (cls === "justify-start") return `.${escapeSelector(cls)} { justify-content: flex-start; }`;
2917
+ if (cls === "justify-end") return `.${escapeSelector(cls)} { justify-content: flex-end; }`;
2918
+ if (cls === "justify-center") return `.${escapeSelector(cls)} { justify-content: center; }`;
2919
+ if (cls === "justify-between") return `.${escapeSelector(cls)} { justify-content: space-between; }`;
2920
+ if (cls === "justify-around") return `.${escapeSelector(cls)} { justify-content: space-around; }`;
2921
+ if (cls === "justify-evenly") return `.${escapeSelector(cls)} { justify-content: space-evenly; }`;
2922
+ if (cls === "justify-stretch") return `.${escapeSelector(cls)} { justify-content: stretch; }`;
2923
+ if (cls === "justify-items-start") return `.${escapeSelector(cls)} { justify-items: start; }`;
2924
+ if (cls === "justify-items-end") return `.${escapeSelector(cls)} { justify-items: end; }`;
2925
+ if (cls === "justify-items-center") return `.${escapeSelector(cls)} { justify-items: center; }`;
2926
+ if (cls === "justify-items-stretch") return `.${escapeSelector(cls)} { justify-items: stretch; }`;
2927
+ if (cls === "justify-self-auto") return `.${escapeSelector(cls)} { justify-self: auto; }`;
2928
+ if (cls === "justify-self-start") return `.${escapeSelector(cls)} { justify-self: start; }`;
2929
+ if (cls === "justify-self-end") return `.${escapeSelector(cls)} { justify-self: end; }`;
2930
+ if (cls === "justify-self-center") return `.${escapeSelector(cls)} { justify-self: center; }`;
2931
+ if (cls === "justify-self-stretch") return `.${escapeSelector(cls)} { justify-self: stretch; }`;
2932
+ if (cls === "content-normal") return `.${escapeSelector(cls)} { align-content: normal; }`;
2933
+ if (cls === "content-center") return `.${escapeSelector(cls)} { align-content: center; }`;
2934
+ if (cls === "content-start") return `.${escapeSelector(cls)} { align-content: flex-start; }`;
2935
+ if (cls === "content-end") return `.${escapeSelector(cls)} { align-content: flex-end; }`;
2936
+ if (cls === "content-between") return `.${escapeSelector(cls)} { align-content: space-between; }`;
2937
+ if (cls === "content-around") return `.${escapeSelector(cls)} { align-content: space-around; }`;
2938
+ if (cls === "content-evenly") return `.${escapeSelector(cls)} { align-content: space-evenly; }`;
2939
+ if (cls === "content-stretch") return `.${escapeSelector(cls)} { align-content: stretch; }`;
2940
+ if (cls === "content-baseline") return `.${escapeSelector(cls)} { align-content: baseline; }`;
2810
2941
  const gridColsMatch = cls.match(/^grid-cols-(\d+)$/);
2811
2942
  if (gridColsMatch) {
2812
2943
  const n = parseInt(gridColsMatch[1]);
2813
- return `.${cls} { grid-template-columns: repeat(${n}, minmax(0, 1fr)); }`;
2944
+ return `.${escapeSelector(cls)} { grid-template-columns: repeat(${n}, minmax(0, 1fr)); }`;
2814
2945
  }
2815
- if (cls === "grid-cols-none") return `.${cls} { grid-template-columns: none; }`;
2946
+ if (cls === "grid-cols-none") return `.${escapeSelector(cls)} { grid-template-columns: none; }`;
2816
2947
  const gridRowsMatch = cls.match(/^grid-rows-(\d+)$/);
2817
2948
  if (gridRowsMatch) {
2818
2949
  const n = parseInt(gridRowsMatch[1]);
2819
- return `.${cls} { grid-template-rows: repeat(${n}, minmax(0, 1fr)); }`;
2950
+ return `.${escapeSelector(cls)} { grid-template-rows: repeat(${n}, minmax(0, 1fr)); }`;
2820
2951
  }
2821
- if (cls === "grid-rows-none") return `.${cls} { grid-template-rows: none; }`;
2952
+ if (cls === "grid-rows-none") return `.${escapeSelector(cls)} { grid-template-rows: none; }`;
2822
2953
  const colSpanMatch = cls.match(/^col-span-(\d+)$/);
2823
- if (colSpanMatch) return `.${cls} { grid-column: span ${colSpanMatch[1]} / span ${colSpanMatch[1]}; }`;
2824
- if (cls === "col-span-full") return `.${cls} { grid-column: 1 / -1; }`;
2825
- if (cls === "col-auto") return `.${cls} { grid-column: auto; }`;
2954
+ if (colSpanMatch) return `.${escapeSelector(cls)} { grid-column: span ${colSpanMatch[1]} / span ${colSpanMatch[1]}; }`;
2955
+ if (cls === "col-span-full") return `.${escapeSelector(cls)} { grid-column: 1 / -1; }`;
2956
+ if (cls === "col-auto") return `.${escapeSelector(cls)} { grid-column: auto; }`;
2826
2957
  const rowSpanMatch = cls.match(/^row-span-(\d+)$/);
2827
- if (rowSpanMatch) return `.${cls} { grid-row: span ${rowSpanMatch[1]} / span ${rowSpanMatch[1]}; }`;
2828
- if (cls === "row-span-full") return `.${cls} { grid-row: 1 / -1; }`;
2829
- if (cls === "row-auto") return `.${cls} { grid-row: auto; }`;
2958
+ if (rowSpanMatch) return `.${escapeSelector(cls)} { grid-row: span ${rowSpanMatch[1]} / span ${rowSpanMatch[1]}; }`;
2959
+ if (cls === "row-span-full") return `.${escapeSelector(cls)} { grid-row: 1 / -1; }`;
2960
+ if (cls === "row-auto") return `.${escapeSelector(cls)} { grid-row: auto; }`;
2830
2961
  const colStartMatch = cls.match(/^col-start-(\d+)$/);
2831
- if (colStartMatch) return `.${cls} { grid-column-start: ${colStartMatch[1]}; }`;
2962
+ if (colStartMatch) return `.${escapeSelector(cls)} { grid-column-start: ${colStartMatch[1]}; }`;
2832
2963
  const colEndMatch = cls.match(/^col-end-(\d+)$/);
2833
- if (colEndMatch) return `.${cls} { grid-column-end: ${colEndMatch[1]}; }`;
2964
+ if (colEndMatch) return `.${escapeSelector(cls)} { grid-column-end: ${colEndMatch[1]}; }`;
2834
2965
  const rowStartMatch = cls.match(/^row-start-(\d+)$/);
2835
- if (rowStartMatch) return `.${cls} { grid-row-start: ${rowStartMatch[1]}; }`;
2966
+ if (rowStartMatch) return `.${escapeSelector(cls)} { grid-row-start: ${rowStartMatch[1]}; }`;
2836
2967
  const rowEndMatch = cls.match(/^row-end-(\d+)$/);
2837
- if (rowEndMatch) return `.${cls} { grid-row-end: ${rowEndMatch[1]}; }`;
2968
+ if (rowEndMatch) return `.${escapeSelector(cls)} { grid-row-end: ${rowEndMatch[1]}; }`;
2838
2969
  const orderMatch = cls.match(/^order-(-?\d+)$/);
2839
- if (orderMatch) return `.${cls} { order: ${orderMatch[1]}; }`;
2840
- if (cls === "order-first") return `.${cls} { order: -9999; }`;
2841
- if (cls === "order-last") return `.${cls} { order: 9999; }`;
2842
- if (cls === "order-none") return `.${cls} { order: 0; }`;
2843
- if (cls === "float-right") return `.${cls} { float: right; }`;
2844
- if (cls === "float-left") return `.${cls} { float: left; }`;
2845
- if (cls === "float-none") return `.${cls} { float: none; }`;
2970
+ if (orderMatch) return `.${escapeSelector(cls)} { order: ${orderMatch[1]}; }`;
2971
+ if (cls === "order-first") return `.${escapeSelector(cls)} { order: -9999; }`;
2972
+ if (cls === "order-last") return `.${escapeSelector(cls)} { order: 9999; }`;
2973
+ if (cls === "order-none") return `.${escapeSelector(cls)} { order: 0; }`;
2974
+ if (cls === "float-right") return `.${escapeSelector(cls)} { float: right; }`;
2975
+ if (cls === "float-left") return `.${escapeSelector(cls)} { float: left; }`;
2976
+ if (cls === "float-none") return `.${escapeSelector(cls)} { float: none; }`;
2846
2977
  if (cls === "clearfix") return `.${cls}::after { content: ""; display: table; clear: both; }`;
2847
- if (cls === "overflow-auto") return `.${cls} { overflow: auto; }`;
2848
- if (cls === "overflow-hidden") return `.${cls} { overflow: hidden; }`;
2849
- if (cls === "overflow-clip") return `.${cls} { overflow: clip; }`;
2850
- if (cls === "overflow-visible") return `.${cls} { overflow: visible; }`;
2851
- if (cls === "overflow-scroll") return `.${cls} { overflow: scroll; }`;
2852
- if (cls === "overflow-x-auto") return `.${cls} { overflow-x: auto; }`;
2853
- if (cls === "overflow-x-hidden") return `.${cls} { overflow-x: hidden; }`;
2854
- if (cls === "overflow-x-scroll") return `.${cls} { overflow-x: scroll; }`;
2855
- if (cls === "overflow-y-auto") return `.${cls} { overflow-y: auto; }`;
2856
- if (cls === "overflow-y-hidden") return `.${cls} { overflow-y: hidden; }`;
2857
- if (cls === "overflow-y-scroll") return `.${cls} { overflow-y: scroll; }`;
2858
- if (cls === "visible") return `.${cls} { visibility: visible; }`;
2859
- if (cls === "invisible") return `.${cls} { visibility: hidden; }`;
2860
- if (cls === "collapse") return `.${cls} { visibility: collapse; }`;
2861
- if (cls === "pointer-events-none") return `.${cls} { pointer-events: none; }`;
2862
- if (cls === "pointer-events-auto") return `.${cls} { pointer-events: auto; }`;
2978
+ if (cls === "overflow-auto") return `.${escapeSelector(cls)} { overflow: auto; }`;
2979
+ if (cls === "overflow-hidden") return `.${escapeSelector(cls)} { overflow: hidden; }`;
2980
+ if (cls === "overflow-clip") return `.${escapeSelector(cls)} { overflow: clip; }`;
2981
+ if (cls === "overflow-visible") return `.${escapeSelector(cls)} { overflow: visible; }`;
2982
+ if (cls === "overflow-scroll") return `.${escapeSelector(cls)} { overflow: scroll; }`;
2983
+ if (cls === "overflow-x-auto") return `.${escapeSelector(cls)} { overflow-x: auto; }`;
2984
+ if (cls === "overflow-x-hidden") return `.${escapeSelector(cls)} { overflow-x: hidden; }`;
2985
+ if (cls === "overflow-x-scroll") return `.${escapeSelector(cls)} { overflow-x: scroll; }`;
2986
+ if (cls === "overflow-y-auto") return `.${escapeSelector(cls)} { overflow-y: auto; }`;
2987
+ if (cls === "overflow-y-hidden") return `.${escapeSelector(cls)} { overflow-y: hidden; }`;
2988
+ if (cls === "overflow-y-scroll") return `.${escapeSelector(cls)} { overflow-y: scroll; }`;
2989
+ if (cls === "visible") return `.${escapeSelector(cls)} { visibility: visible; }`;
2990
+ if (cls === "invisible") return `.${escapeSelector(cls)} { visibility: hidden; }`;
2991
+ if (cls === "collapse") return `.${escapeSelector(cls)} { visibility: collapse; }`;
2992
+ if (cls === "pointer-events-none") return `.${escapeSelector(cls)} { pointer-events: none; }`;
2993
+ if (cls === "pointer-events-auto") return `.${escapeSelector(cls)} { pointer-events: auto; }`;
2863
2994
  const cursorMap = {
2864
2995
  "cursor-auto": "auto",
2865
2996
  "cursor-default": "default",
@@ -2876,30 +3007,30 @@ function matchLayout(cls) {
2876
3007
  "cursor-zoom-in": "zoom-in",
2877
3008
  "cursor-zoom-out": "zoom-out"
2878
3009
  };
2879
- if (cursorMap[cls]) return `.${cls} { cursor: ${cursorMap[cls]}; }`;
2880
- if (cls === "select-none") return `.${cls} { user-select: none; }`;
2881
- if (cls === "select-text") return `.${cls} { user-select: text; }`;
2882
- if (cls === "select-all") return `.${cls} { user-select: all; }`;
2883
- if (cls === "select-auto") return `.${cls} { user-select: auto; }`;
2884
- if (cls === "object-contain") return `.${cls} { object-fit: contain; }`;
2885
- if (cls === "object-cover") return `.${cls} { object-fit: cover; }`;
2886
- if (cls === "object-fill") return `.${cls} { object-fit: fill; }`;
2887
- if (cls === "object-none") return `.${cls} { object-fit: none; }`;
2888
- if (cls === "object-scale-down") return `.${cls} { object-fit: scale-down; }`;
2889
- if (cls === "aspect-auto") return `.${cls} { aspect-ratio: auto; }`;
2890
- if (cls === "aspect-square") return `.${cls} { aspect-ratio: 1 / 1; }`;
2891
- if (cls === "aspect-video") return `.${cls} { aspect-ratio: 16 / 9; }`;
3010
+ if (cursorMap[cls]) return `.${escapeSelector(cls)} { cursor: ${cursorMap[cls]}; }`;
3011
+ if (cls === "select-none") return `.${escapeSelector(cls)} { user-select: none; }`;
3012
+ if (cls === "select-text") return `.${escapeSelector(cls)} { user-select: text; }`;
3013
+ if (cls === "select-all") return `.${escapeSelector(cls)} { user-select: all; }`;
3014
+ if (cls === "select-auto") return `.${escapeSelector(cls)} { user-select: auto; }`;
3015
+ if (cls === "object-contain") return `.${escapeSelector(cls)} { object-fit: contain; }`;
3016
+ if (cls === "object-cover") return `.${escapeSelector(cls)} { object-fit: cover; }`;
3017
+ if (cls === "object-fill") return `.${escapeSelector(cls)} { object-fit: fill; }`;
3018
+ if (cls === "object-none") return `.${escapeSelector(cls)} { object-fit: none; }`;
3019
+ if (cls === "object-scale-down") return `.${escapeSelector(cls)} { object-fit: scale-down; }`;
3020
+ if (cls === "aspect-auto") return `.${escapeSelector(cls)} { aspect-ratio: auto; }`;
3021
+ if (cls === "aspect-square") return `.${escapeSelector(cls)} { aspect-ratio: 1 / 1; }`;
3022
+ if (cls === "aspect-video") return `.${escapeSelector(cls)} { aspect-ratio: 16 / 9; }`;
2892
3023
  if (cls === "container") {
2893
- return `.${cls} {
3024
+ return `.${escapeSelector(cls)} {
2894
3025
  width: 100%;
2895
3026
  margin-left: auto;
2896
3027
  margin-right: auto;
2897
3028
  }`;
2898
3029
  }
2899
- if (cls === "box-border") return `.${cls} { box-sizing: border-box; }`;
2900
- if (cls === "box-content") return `.${cls} { box-sizing: content-box; }`;
2901
- if (cls === "isolate") return `.${cls} { isolation: isolate; }`;
2902
- if (cls === "isolation-auto") return `.${cls} { isolation: auto; }`;
3030
+ if (cls === "box-border") return `.${escapeSelector(cls)} { box-sizing: border-box; }`;
3031
+ if (cls === "box-content") return `.${escapeSelector(cls)} { box-sizing: content-box; }`;
3032
+ if (cls === "isolate") return `.${escapeSelector(cls)} { isolation: isolate; }`;
3033
+ if (cls === "isolation-auto") return `.${escapeSelector(cls)} { isolation: auto; }`;
2903
3034
  const mixBlendMap = {
2904
3035
  "mix-blend-normal": "normal",
2905
3036
  "mix-blend-multiply": "multiply",
@@ -2914,40 +3045,40 @@ function matchLayout(cls) {
2914
3045
  "mix-blend-difference": "difference",
2915
3046
  "mix-blend-exclusion": "exclusion"
2916
3047
  };
2917
- if (mixBlendMap[cls]) return `.${cls} { mix-blend-mode: ${mixBlendMap[cls]}; }`;
2918
- if (cls === "bg-auto") return `.${cls} { background-size: auto; }`;
2919
- if (cls === "bg-cover") return `.${cls} { background-size: cover; }`;
2920
- if (cls === "bg-contain") return `.${cls} { background-size: contain; }`;
2921
- if (cls === "bg-center") return `.${cls} { background-position: center; }`;
2922
- if (cls === "bg-top") return `.${cls} { background-position: top; }`;
2923
- if (cls === "bg-bottom") return `.${cls} { background-position: bottom; }`;
2924
- if (cls === "bg-left") return `.${cls} { background-position: left; }`;
2925
- if (cls === "bg-right") return `.${cls} { background-position: right; }`;
2926
- if (cls === "bg-left-top") return `.${cls} { background-position: left top; }`;
2927
- if (cls === "bg-left-bottom") return `.${cls} { background-position: left bottom; }`;
2928
- if (cls === "bg-right-top") return `.${cls} { background-position: right top; }`;
2929
- if (cls === "bg-right-bottom") return `.${cls} { background-position: right bottom; }`;
2930
- if (cls === "bg-repeat") return `.${cls} { background-repeat: repeat; }`;
2931
- if (cls === "bg-no-repeat") return `.${cls} { background-repeat: no-repeat; }`;
2932
- if (cls === "bg-repeat-x") return `.${cls} { background-repeat: repeat-x; }`;
2933
- if (cls === "bg-repeat-y") return `.${cls} { background-repeat: repeat-y; }`;
2934
- if (cls === "bg-repeat-round") return `.${cls} { background-repeat: round; }`;
2935
- if (cls === "bg-repeat-space") return `.${cls} { background-repeat: space; }`;
2936
- if (cls === "bg-fixed") return `.${cls} { background-attachment: fixed; }`;
2937
- if (cls === "bg-local") return `.${cls} { background-attachment: local; }`;
2938
- if (cls === "bg-scroll") return `.${cls} { background-attachment: scroll; }`;
2939
- if (cls === "bg-origin-border") return `.${cls} { background-origin: border-box; }`;
2940
- if (cls === "bg-origin-padding") return `.${cls} { background-origin: padding-box; }`;
2941
- if (cls === "bg-origin-content") return `.${cls} { background-origin: content-box; }`;
2942
- if (cls === "bg-clip-border") return `.${cls} { background-clip: border-box; }`;
2943
- if (cls === "bg-clip-padding") return `.${cls} { background-clip: padding-box; }`;
2944
- if (cls === "bg-clip-content") return `.${cls} { background-clip: content-box; }`;
2945
- if (cls === "bg-clip-text") return `.${cls} { background-clip: text; -webkit-background-clip: text; }`;
3048
+ if (mixBlendMap[cls]) return `.${escapeSelector(cls)} { mix-blend-mode: ${mixBlendMap[cls]}; }`;
3049
+ if (cls === "bg-auto") return `.${escapeSelector(cls)} { background-size: auto; }`;
3050
+ if (cls === "bg-cover") return `.${escapeSelector(cls)} { background-size: cover; }`;
3051
+ if (cls === "bg-contain") return `.${escapeSelector(cls)} { background-size: contain; }`;
3052
+ if (cls === "bg-center") return `.${escapeSelector(cls)} { background-position: center; }`;
3053
+ if (cls === "bg-top") return `.${escapeSelector(cls)} { background-position: top; }`;
3054
+ if (cls === "bg-bottom") return `.${escapeSelector(cls)} { background-position: bottom; }`;
3055
+ if (cls === "bg-left") return `.${escapeSelector(cls)} { background-position: left; }`;
3056
+ if (cls === "bg-right") return `.${escapeSelector(cls)} { background-position: right; }`;
3057
+ if (cls === "bg-left-top") return `.${escapeSelector(cls)} { background-position: left top; }`;
3058
+ if (cls === "bg-left-bottom") return `.${escapeSelector(cls)} { background-position: left bottom; }`;
3059
+ if (cls === "bg-right-top") return `.${escapeSelector(cls)} { background-position: right top; }`;
3060
+ if (cls === "bg-right-bottom") return `.${escapeSelector(cls)} { background-position: right bottom; }`;
3061
+ if (cls === "bg-repeat") return `.${escapeSelector(cls)} { background-repeat: repeat; }`;
3062
+ if (cls === "bg-no-repeat") return `.${escapeSelector(cls)} { background-repeat: no-repeat; }`;
3063
+ if (cls === "bg-repeat-x") return `.${escapeSelector(cls)} { background-repeat: repeat-x; }`;
3064
+ if (cls === "bg-repeat-y") return `.${escapeSelector(cls)} { background-repeat: repeat-y; }`;
3065
+ if (cls === "bg-repeat-round") return `.${escapeSelector(cls)} { background-repeat: round; }`;
3066
+ if (cls === "bg-repeat-space") return `.${escapeSelector(cls)} { background-repeat: space; }`;
3067
+ if (cls === "bg-fixed") return `.${escapeSelector(cls)} { background-attachment: fixed; }`;
3068
+ if (cls === "bg-local") return `.${escapeSelector(cls)} { background-attachment: local; }`;
3069
+ if (cls === "bg-scroll") return `.${escapeSelector(cls)} { background-attachment: scroll; }`;
3070
+ if (cls === "bg-origin-border") return `.${escapeSelector(cls)} { background-origin: border-box; }`;
3071
+ if (cls === "bg-origin-padding") return `.${escapeSelector(cls)} { background-origin: padding-box; }`;
3072
+ if (cls === "bg-origin-content") return `.${escapeSelector(cls)} { background-origin: content-box; }`;
3073
+ if (cls === "bg-clip-border") return `.${escapeSelector(cls)} { background-clip: border-box; }`;
3074
+ if (cls === "bg-clip-padding") return `.${escapeSelector(cls)} { background-clip: padding-box; }`;
3075
+ if (cls === "bg-clip-content") return `.${escapeSelector(cls)} { background-clip: content-box; }`;
3076
+ if (cls === "bg-clip-text") return `.${escapeSelector(cls)} { background-clip: text; -webkit-background-clip: text; }`;
2946
3077
  return null;
2947
3078
  }
2948
3079
 
2949
3080
  // src/generator/sizing.ts
2950
- function has3(obj, key) {
3081
+ function has2(obj, key) {
2951
3082
  return typeof obj[key] === "string";
2952
3083
  }
2953
3084
  function generateSizing(classes, config) {
@@ -2991,25 +3122,25 @@ function matchSizing(cls, spacing) {
2991
3122
  const wMatch = cls.match(/^w-(.+)$/);
2992
3123
  if (wMatch) {
2993
3124
  const key = wMatch[1];
2994
- if (key === "auto") return `.${cls} { width: auto; }`;
2995
- if (key === "full") return `.${cls} { width: 100%; }`;
2996
- if (key === "screen") return `.${cls} { width: 100vw; }`;
2997
- if (key === "svw") return `.${cls} { width: 100svw; }`;
2998
- if (key === "min") return `.${cls} { width: min-content; }`;
2999
- if (key === "max") return `.${cls} { width: max-content; }`;
3000
- if (key === "fit") return `.${cls} { width: fit-content; }`;
3001
- if (has3(fractions, key)) return `.${cls} { width: ${fractions[key]}; }`;
3002
- if (has3(spacing, key)) return `.${cls} { width: ${spacing[key]}; }`;
3125
+ if (key === "auto") return `.${escapeSelector(cls)} { width: auto; }`;
3126
+ if (key === "full") return `.${escapeSelector(cls)} { width: 100%; }`;
3127
+ if (key === "screen") return `.${escapeSelector(cls)} { width: 100vw; }`;
3128
+ if (key === "svw") return `.${escapeSelector(cls)} { width: 100svw; }`;
3129
+ if (key === "min") return `.${escapeSelector(cls)} { width: min-content; }`;
3130
+ if (key === "max") return `.${escapeSelector(cls)} { width: max-content; }`;
3131
+ if (key === "fit") return `.${escapeSelector(cls)} { width: fit-content; }`;
3132
+ if (has2(fractions, key)) return `.${escapeSelector(cls)} { width: ${fractions[key]}; }`;
3133
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { width: ${spacing[key]}; }`;
3003
3134
  }
3004
3135
  const minWMatch = cls.match(/^min-w-(.+)$/);
3005
3136
  if (minWMatch) {
3006
3137
  const key = minWMatch[1];
3007
- if (key === "0") return `.${cls} { min-width: 0px; }`;
3008
- if (key === "full") return `.${cls} { min-width: 100%; }`;
3009
- if (key === "min") return `.${cls} { min-width: min-content; }`;
3010
- if (key === "max") return `.${cls} { min-width: max-content; }`;
3011
- if (key === "fit") return `.${cls} { min-width: fit-content; }`;
3012
- if (has3(spacing, key)) return `.${cls} { min-width: ${spacing[key]}; }`;
3138
+ if (key === "0") return `.${escapeSelector(cls)} { min-width: 0px; }`;
3139
+ if (key === "full") return `.${escapeSelector(cls)} { min-width: 100%; }`;
3140
+ if (key === "min") return `.${escapeSelector(cls)} { min-width: min-content; }`;
3141
+ if (key === "max") return `.${escapeSelector(cls)} { min-width: max-content; }`;
3142
+ if (key === "fit") return `.${escapeSelector(cls)} { min-width: fit-content; }`;
3143
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { min-width: ${spacing[key]}; }`;
3013
3144
  }
3014
3145
  const maxWMap = {
3015
3146
  none: "none",
@@ -3036,59 +3167,59 @@ function matchSizing(cls, spacing) {
3036
3167
  "screen-2xl": "1536px"
3037
3168
  };
3038
3169
  const maxWMatch = cls.match(/^max-w-(.+)$/);
3039
- if (maxWMatch && has3(maxWMap, maxWMatch[1])) {
3040
- return `.${cls} { max-width: ${maxWMap[maxWMatch[1]]}; }`;
3170
+ if (maxWMatch && has2(maxWMap, maxWMatch[1])) {
3171
+ return `.${escapeSelector(cls)} { max-width: ${maxWMap[maxWMatch[1]]}; }`;
3041
3172
  }
3042
3173
  const hMatch = cls.match(/^h-(.+)$/);
3043
3174
  if (hMatch) {
3044
3175
  const key = hMatch[1];
3045
- if (key === "auto") return `.${cls} { height: auto; }`;
3046
- if (key === "full") return `.${cls} { height: 100%; }`;
3047
- if (key === "screen") return `.${cls} { height: 100vh; }`;
3048
- if (key === "svh") return `.${cls} { height: 100svh; }`;
3049
- if (key === "dvh") return `.${cls} { height: 100dvh; }`;
3050
- if (key === "min") return `.${cls} { height: min-content; }`;
3051
- if (key === "max") return `.${cls} { height: max-content; }`;
3052
- if (key === "fit") return `.${cls} { height: fit-content; }`;
3053
- if (has3(fractions, key)) return `.${cls} { height: ${fractions[key]}; }`;
3054
- if (has3(spacing, key)) return `.${cls} { height: ${spacing[key]}; }`;
3176
+ if (key === "auto") return `.${escapeSelector(cls)} { height: auto; }`;
3177
+ if (key === "full") return `.${escapeSelector(cls)} { height: 100%; }`;
3178
+ if (key === "screen") return `.${escapeSelector(cls)} { height: 100vh; }`;
3179
+ if (key === "svh") return `.${escapeSelector(cls)} { height: 100svh; }`;
3180
+ if (key === "dvh") return `.${escapeSelector(cls)} { height: 100dvh; }`;
3181
+ if (key === "min") return `.${escapeSelector(cls)} { height: min-content; }`;
3182
+ if (key === "max") return `.${escapeSelector(cls)} { height: max-content; }`;
3183
+ if (key === "fit") return `.${escapeSelector(cls)} { height: fit-content; }`;
3184
+ if (has2(fractions, key)) return `.${escapeSelector(cls)} { height: ${fractions[key]}; }`;
3185
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { height: ${spacing[key]}; }`;
3055
3186
  }
3056
3187
  const minHMatch = cls.match(/^min-h-(.+)$/);
3057
3188
  if (minHMatch) {
3058
3189
  const key = minHMatch[1];
3059
- if (key === "0") return `.${cls} { min-height: 0px; }`;
3060
- if (key === "full") return `.${cls} { min-height: 100%; }`;
3061
- if (key === "screen") return `.${cls} { min-height: 100vh; }`;
3062
- if (key === "svh") return `.${cls} { min-height: 100svh; }`;
3063
- if (key === "dvh") return `.${cls} { min-height: 100dvh; }`;
3064
- if (key === "fit") return `.${cls} { min-height: fit-content; }`;
3065
- if (has3(spacing, key)) return `.${cls} { min-height: ${spacing[key]}; }`;
3190
+ if (key === "0") return `.${escapeSelector(cls)} { min-height: 0px; }`;
3191
+ if (key === "full") return `.${escapeSelector(cls)} { min-height: 100%; }`;
3192
+ if (key === "screen") return `.${escapeSelector(cls)} { min-height: 100vh; }`;
3193
+ if (key === "svh") return `.${escapeSelector(cls)} { min-height: 100svh; }`;
3194
+ if (key === "dvh") return `.${escapeSelector(cls)} { min-height: 100dvh; }`;
3195
+ if (key === "fit") return `.${escapeSelector(cls)} { min-height: fit-content; }`;
3196
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { min-height: ${spacing[key]}; }`;
3066
3197
  }
3067
3198
  const maxHMatch = cls.match(/^max-h-(.+)$/);
3068
3199
  if (maxHMatch) {
3069
3200
  const key = maxHMatch[1];
3070
- if (key === "none") return `.${cls} { max-height: none; }`;
3071
- if (key === "full") return `.${cls} { max-height: 100%; }`;
3072
- if (key === "screen") return `.${cls} { max-height: 100vh; }`;
3073
- if (key === "svh") return `.${cls} { max-height: 100svh; }`;
3074
- if (key === "dvh") return `.${cls} { max-height: 100dvh; }`;
3075
- if (key === "fit") return `.${cls} { max-height: fit-content; }`;
3076
- if (has3(spacing, key)) return `.${cls} { max-height: ${spacing[key]}; }`;
3201
+ if (key === "none") return `.${escapeSelector(cls)} { max-height: none; }`;
3202
+ if (key === "full") return `.${escapeSelector(cls)} { max-height: 100%; }`;
3203
+ if (key === "screen") return `.${escapeSelector(cls)} { max-height: 100vh; }`;
3204
+ if (key === "svh") return `.${escapeSelector(cls)} { max-height: 100svh; }`;
3205
+ if (key === "dvh") return `.${escapeSelector(cls)} { max-height: 100dvh; }`;
3206
+ if (key === "fit") return `.${escapeSelector(cls)} { max-height: fit-content; }`;
3207
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { max-height: ${spacing[key]}; }`;
3077
3208
  }
3078
3209
  const basisMatch = cls.match(/^basis-(.+)$/);
3079
3210
  if (basisMatch) {
3080
3211
  const key = basisMatch[1];
3081
- if (key === "auto") return `.${cls} { flex-basis: auto; }`;
3082
- if (key === "full") return `.${cls} { flex-basis: 100%; }`;
3083
- if (key === "0") return `.${cls} { flex-basis: 0px; }`;
3084
- if (has3(fractions, key)) return `.${cls} { flex-basis: ${fractions[key]}; }`;
3085
- if (has3(spacing, key)) return `.${cls} { flex-basis: ${spacing[key]}; }`;
3212
+ if (key === "auto") return `.${escapeSelector(cls)} { flex-basis: auto; }`;
3213
+ if (key === "full") return `.${escapeSelector(cls)} { flex-basis: 100%; }`;
3214
+ if (key === "0") return `.${escapeSelector(cls)} { flex-basis: 0px; }`;
3215
+ if (has2(fractions, key)) return `.${escapeSelector(cls)} { flex-basis: ${fractions[key]}; }`;
3216
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { flex-basis: ${spacing[key]}; }`;
3086
3217
  }
3087
3218
  return null;
3088
3219
  }
3089
3220
 
3090
3221
  // src/generator/effects.ts
3091
- function has4(obj, key) {
3222
+ function has3(obj, key) {
3092
3223
  return typeof obj[key] === "string";
3093
3224
  }
3094
3225
  function generateEffects(classes, config) {
@@ -3102,8 +3233,8 @@ function generateEffects(classes, config) {
3102
3233
  }
3103
3234
  function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3104
3235
  const opacityMatch = cls.match(/^opacity-(.+)$/);
3105
- if (opacityMatch && has4(opacity, opacityMatch[1])) {
3106
- return `.${cls} {
3236
+ if (opacityMatch && has3(opacity, opacityMatch[1])) {
3237
+ return `.${escapeSelector(cls)} {
3107
3238
  opacity: ${opacity[opacityMatch[1]]};
3108
3239
  transition-property: opacity;
3109
3240
  transition-duration: var(--alive-duration, 0ms);
@@ -3111,87 +3242,87 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3111
3242
  }`;
3112
3243
  }
3113
3244
  const zMatch = cls.match(/^z-(.+)$/);
3114
- if (zMatch && has4(zIndex, zMatch[1])) {
3115
- return `.${cls} { z-index: ${zIndex[zMatch[1]]}; }`;
3245
+ if (zMatch && has3(zIndex, zMatch[1])) {
3246
+ return `.${escapeSelector(cls)} { z-index: ${zIndex[zMatch[1]]}; }`;
3116
3247
  }
3117
3248
  const shadowMatch = cls.match(/^shadow(?:-(.+))?$/);
3118
3249
  if (shadowMatch) {
3119
3250
  const key = shadowMatch[1] ?? "DEFAULT";
3120
- if (has4(boxShadow, key)) {
3121
- return `.${cls} { box-shadow: ${boxShadow[key]}; }`;
3251
+ if (has3(boxShadow, key)) {
3252
+ return `.${escapeSelector(cls)} { box-shadow: ${boxShadow[key]}; }`;
3122
3253
  }
3123
- if (!shadowMatch[1] && has4(boxShadow, "DEFAULT")) {
3124
- return `.${cls} { box-shadow: ${boxShadow["DEFAULT"]}; }`;
3254
+ if (!shadowMatch[1] && has3(boxShadow, "DEFAULT")) {
3255
+ return `.${escapeSelector(cls)} { box-shadow: ${boxShadow["DEFAULT"]}; }`;
3125
3256
  }
3126
3257
  }
3127
3258
  const roundedMatch = cls.match(/^rounded(?:-(.+))?$/);
3128
3259
  if (roundedMatch) {
3129
3260
  const key = roundedMatch[1] ?? "DEFAULT";
3130
- if (has4(borderRadius, key)) return `.${cls} { border-radius: ${borderRadius[key]}; }`;
3131
- if (!roundedMatch[1] && has4(borderRadius, "DEFAULT")) return `.${cls} { border-radius: ${borderRadius["DEFAULT"]}; }`;
3261
+ if (has3(borderRadius, key)) return `.${escapeSelector(cls)} { border-radius: ${borderRadius[key]}; }`;
3262
+ if (!roundedMatch[1] && has3(borderRadius, "DEFAULT")) return `.${escapeSelector(cls)} { border-radius: ${borderRadius["DEFAULT"]}; }`;
3132
3263
  }
3133
3264
  const roundedTMatch = cls.match(/^rounded-t(?:-(.+))?$/);
3134
3265
  if (roundedTMatch) {
3135
3266
  const rkey = roundedTMatch[1] ?? "DEFAULT";
3136
- const val = has4(borderRadius, rkey) ? borderRadius[rkey] : has4(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3137
- if (val) return `.${cls} { border-top-left-radius: ${val}; border-top-right-radius: ${val}; }`;
3267
+ const val = has3(borderRadius, rkey) ? borderRadius[rkey] : has3(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3268
+ if (val) return `.${escapeSelector(cls)} { border-top-left-radius: ${val}; border-top-right-radius: ${val}; }`;
3138
3269
  }
3139
3270
  const roundedBMatch = cls.match(/^rounded-b(?:-(.+))?$/);
3140
3271
  if (roundedBMatch) {
3141
3272
  const rkey = roundedBMatch[1] ?? "DEFAULT";
3142
- const val = has4(borderRadius, rkey) ? borderRadius[rkey] : has4(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3143
- if (val) return `.${cls} { border-bottom-left-radius: ${val}; border-bottom-right-radius: ${val}; }`;
3273
+ const val = has3(borderRadius, rkey) ? borderRadius[rkey] : has3(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3274
+ if (val) return `.${escapeSelector(cls)} { border-bottom-left-radius: ${val}; border-bottom-right-radius: ${val}; }`;
3144
3275
  }
3145
3276
  const roundedLMatch = cls.match(/^rounded-l(?:-(.+))?$/);
3146
3277
  if (roundedLMatch) {
3147
3278
  const rkey = roundedLMatch[1] ?? "DEFAULT";
3148
- const val = has4(borderRadius, rkey) ? borderRadius[rkey] : has4(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3149
- if (val) return `.${cls} { border-top-left-radius: ${val}; border-bottom-left-radius: ${val}; }`;
3279
+ const val = has3(borderRadius, rkey) ? borderRadius[rkey] : has3(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3280
+ if (val) return `.${escapeSelector(cls)} { border-top-left-radius: ${val}; border-bottom-left-radius: ${val}; }`;
3150
3281
  }
3151
3282
  const roundedRMatch = cls.match(/^rounded-r(?:-(.+))?$/);
3152
3283
  if (roundedRMatch) {
3153
3284
  const rkey = roundedRMatch[1] ?? "DEFAULT";
3154
- const val = has4(borderRadius, rkey) ? borderRadius[rkey] : has4(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3155
- if (val) return `.${cls} { border-top-right-radius: ${val}; border-bottom-right-radius: ${val}; }`;
3156
- }
3157
- if (cls === "border") return `.${cls} { border-width: 1px; border-style: solid; }`;
3158
- if (cls === "border-0") return `.${cls} { border-width: 0px; }`;
3159
- if (cls === "border-2") return `.${cls} { border-width: 2px; border-style: solid; }`;
3160
- if (cls === "border-4") return `.${cls} { border-width: 4px; border-style: solid; }`;
3161
- if (cls === "border-8") return `.${cls} { border-width: 8px; border-style: solid; }`;
3162
- if (cls === "border-t") return `.${cls} { border-top-width: 1px; border-top-style: solid; }`;
3163
- if (cls === "border-r") return `.${cls} { border-right-width: 1px; border-right-style: solid; }`;
3164
- if (cls === "border-b") return `.${cls} { border-bottom-width: 1px; border-bottom-style: solid; }`;
3165
- if (cls === "border-l") return `.${cls} { border-left-width: 1px; border-left-style: solid; }`;
3166
- if (cls === "border-t-0") return `.${cls} { border-top-width: 0px; }`;
3167
- if (cls === "border-r-0") return `.${cls} { border-right-width: 0px; }`;
3168
- if (cls === "border-b-0") return `.${cls} { border-bottom-width: 0px; }`;
3169
- if (cls === "border-l-0") return `.${cls} { border-left-width: 0px; }`;
3170
- if (cls === "border-solid") return `.${cls} { border-style: solid; }`;
3171
- if (cls === "border-dashed") return `.${cls} { border-style: dashed; }`;
3172
- if (cls === "border-dotted") return `.${cls} { border-style: dotted; }`;
3173
- if (cls === "border-double") return `.${cls} { border-style: double; }`;
3174
- if (cls === "border-hidden") return `.${cls} { border-style: hidden; }`;
3175
- if (cls === "border-none") return `.${cls} { border-style: none; }`;
3176
- if (cls === "outline-none") return `.${cls} { outline: 2px solid transparent; outline-offset: 2px; }`;
3177
- if (cls === "outline") return `.${cls} { outline-style: solid; }`;
3178
- if (cls === "outline-dashed") return `.${cls} { outline-style: dashed; }`;
3179
- if (cls === "outline-dotted") return `.${cls} { outline-style: dotted; }`;
3180
- if (cls === "outline-double") return `.${cls} { outline-style: double; }`;
3285
+ const val = has3(borderRadius, rkey) ? borderRadius[rkey] : has3(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3286
+ if (val) return `.${escapeSelector(cls)} { border-top-right-radius: ${val}; border-bottom-right-radius: ${val}; }`;
3287
+ }
3288
+ if (cls === "border") return `.${escapeSelector(cls)} { border-width: 1px; border-style: solid; }`;
3289
+ if (cls === "border-0") return `.${escapeSelector(cls)} { border-width: 0px; }`;
3290
+ if (cls === "border-2") return `.${escapeSelector(cls)} { border-width: 2px; border-style: solid; }`;
3291
+ if (cls === "border-4") return `.${escapeSelector(cls)} { border-width: 4px; border-style: solid; }`;
3292
+ if (cls === "border-8") return `.${escapeSelector(cls)} { border-width: 8px; border-style: solid; }`;
3293
+ if (cls === "border-t") return `.${escapeSelector(cls)} { border-top-width: 1px; border-top-style: solid; }`;
3294
+ if (cls === "border-r") return `.${escapeSelector(cls)} { border-right-width: 1px; border-right-style: solid; }`;
3295
+ if (cls === "border-b") return `.${escapeSelector(cls)} { border-bottom-width: 1px; border-bottom-style: solid; }`;
3296
+ if (cls === "border-l") return `.${escapeSelector(cls)} { border-left-width: 1px; border-left-style: solid; }`;
3297
+ if (cls === "border-t-0") return `.${escapeSelector(cls)} { border-top-width: 0px; }`;
3298
+ if (cls === "border-r-0") return `.${escapeSelector(cls)} { border-right-width: 0px; }`;
3299
+ if (cls === "border-b-0") return `.${escapeSelector(cls)} { border-bottom-width: 0px; }`;
3300
+ if (cls === "border-l-0") return `.${escapeSelector(cls)} { border-left-width: 0px; }`;
3301
+ if (cls === "border-solid") return `.${escapeSelector(cls)} { border-style: solid; }`;
3302
+ if (cls === "border-dashed") return `.${escapeSelector(cls)} { border-style: dashed; }`;
3303
+ if (cls === "border-dotted") return `.${escapeSelector(cls)} { border-style: dotted; }`;
3304
+ if (cls === "border-double") return `.${escapeSelector(cls)} { border-style: double; }`;
3305
+ if (cls === "border-hidden") return `.${escapeSelector(cls)} { border-style: hidden; }`;
3306
+ if (cls === "border-none") return `.${escapeSelector(cls)} { border-style: none; }`;
3307
+ if (cls === "outline-none") return `.${escapeSelector(cls)} { outline: 2px solid transparent; outline-offset: 2px; }`;
3308
+ if (cls === "outline") return `.${escapeSelector(cls)} { outline-style: solid; }`;
3309
+ if (cls === "outline-dashed") return `.${escapeSelector(cls)} { outline-style: dashed; }`;
3310
+ if (cls === "outline-dotted") return `.${escapeSelector(cls)} { outline-style: dotted; }`;
3311
+ if (cls === "outline-double") return `.${escapeSelector(cls)} { outline-style: double; }`;
3181
3312
  const outlineWidthMatch = cls.match(/^outline-(\d+)$/);
3182
- if (outlineWidthMatch) return `.${cls} { outline-width: ${outlineWidthMatch[1]}px; }`;
3313
+ if (outlineWidthMatch) return `.${escapeSelector(cls)} { outline-width: ${outlineWidthMatch[1]}px; }`;
3183
3314
  const outlineOffsetMatch = cls.match(/^outline-offset-(\d+)$/);
3184
- if (outlineOffsetMatch) return `.${cls} { outline-offset: ${outlineOffsetMatch[1]}px; }`;
3315
+ if (outlineOffsetMatch) return `.${escapeSelector(cls)} { outline-offset: ${outlineOffsetMatch[1]}px; }`;
3185
3316
  const ringMatch = cls.match(/^ring(?:-(\d+))?$/);
3186
3317
  if (ringMatch) {
3187
3318
  const width = ringMatch[1] ?? "3";
3188
- return `.${cls} { box-shadow: 0 0 0 ${width}px var(--alive-ring-color, rgba(59, 130, 246, 0.5)); }`;
3319
+ return `.${escapeSelector(cls)} { box-shadow: 0 0 0 ${width}px var(--alive-ring-color, rgba(59, 130, 246, 0.5)); }`;
3189
3320
  }
3190
- if (cls === "ring-inset") return `.${cls} { --alive-ring-inset: inset; }`;
3321
+ if (cls === "ring-inset") return `.${escapeSelector(cls)} { --alive-ring-inset: inset; }`;
3191
3322
  const ringOffsetMatch = cls.match(/^ring-offset-(\d+)$/);
3192
- if (ringOffsetMatch) return `.${cls} { --alive-ring-offset: ${ringOffsetMatch[1]}px; }`;
3193
- if (cls === "transform") return `.${cls} { transform: translateX(var(--alive-tx,0)) translateY(var(--alive-ty,0)) rotate(var(--alive-rotate,0)) scaleX(var(--alive-sx,1)) scaleY(var(--alive-sy,1)) skewX(var(--alive-skew-x,0)) skewY(var(--alive-skew-y,0)); }`;
3194
- if (cls === "transform-none") return `.${cls} { transform: none; }`;
3323
+ if (ringOffsetMatch) return `.${escapeSelector(cls)} { --alive-ring-offset: ${ringOffsetMatch[1]}px; }`;
3324
+ if (cls === "transform") return `.${escapeSelector(cls)} { transform: translateX(var(--alive-tx,0)) translateY(var(--alive-ty,0)) rotate(var(--alive-rotate,0)) scaleX(var(--alive-sx,1)) scaleY(var(--alive-sy,1)) skewX(var(--alive-skew-x,0)) skewY(var(--alive-skew-y,0)); }`;
3325
+ if (cls === "transform-none") return `.${escapeSelector(cls)} { transform: none; }`;
3195
3326
  const scaleMap = {
3196
3327
  "0": "0",
3197
3328
  "50": ".5",
@@ -3205,16 +3336,16 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3205
3336
  "150": "1.5"
3206
3337
  };
3207
3338
  const scaleMatch = cls.match(/^scale-(\d+)$/);
3208
- if (scaleMatch && has4(scaleMap, scaleMatch[1])) {
3209
- return `.${cls} { transform: scale(${scaleMap[scaleMatch[1]]}); }`;
3339
+ if (scaleMatch && has3(scaleMap, scaleMatch[1])) {
3340
+ return `.${escapeSelector(cls)} { transform: scale(${scaleMap[scaleMatch[1]]}); }`;
3210
3341
  }
3211
3342
  const scaleXMatch = cls.match(/^scale-x-(\d+)$/);
3212
- if (scaleXMatch && has4(scaleMap, scaleXMatch[1])) {
3213
- return `.${cls} { transform: scaleX(${scaleMap[scaleXMatch[1]]}); }`;
3343
+ if (scaleXMatch && has3(scaleMap, scaleXMatch[1])) {
3344
+ return `.${escapeSelector(cls)} { transform: scaleX(${scaleMap[scaleXMatch[1]]}); }`;
3214
3345
  }
3215
3346
  const scaleYMatch = cls.match(/^scale-y-(\d+)$/);
3216
- if (scaleYMatch && has4(scaleMap, scaleYMatch[1])) {
3217
- return `.${cls} { transform: scaleY(${scaleMap[scaleYMatch[1]]}); }`;
3347
+ if (scaleYMatch && has3(scaleMap, scaleYMatch[1])) {
3348
+ return `.${escapeSelector(cls)} { transform: scaleY(${scaleMap[scaleYMatch[1]]}); }`;
3218
3349
  }
3219
3350
  const rotateMatch = cls.match(/^-?rotate-(\d+)$/);
3220
3351
  if (rotateMatch) {
@@ -3237,12 +3368,12 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3237
3368
  const val = fractions[key] ?? null;
3238
3369
  if (val) return `.${cls.replace(/^-/, "\\-")} { transform: translateY(${neg}${val}); }`;
3239
3370
  }
3240
- if (cls === "transition-none") return `.${cls} { transition: none; }`;
3241
- if (cls === "transition-all") return `.${cls} { transition: all var(--alive-duration-normal) var(--alive-ease-standard); }`;
3242
- if (cls === "transition-colors") return `.${cls} { transition: color, background-color, border-color, text-decoration-color, fill, stroke; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3243
- if (cls === "transition-opacity") return `.${cls} { transition: opacity; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3244
- if (cls === "transition-shadow") return `.${cls} { transition: box-shadow; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3245
- if (cls === "transition-transform") return `.${cls} { transition: transform; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3371
+ if (cls === "transition-none") return `.${escapeSelector(cls)} { transition: none; }`;
3372
+ if (cls === "transition-all") return `.${escapeSelector(cls)} { transition: all var(--alive-duration-normal) var(--alive-ease-standard); }`;
3373
+ if (cls === "transition-colors") return `.${escapeSelector(cls)} { transition: color, background-color, border-color, text-decoration-color, fill, stroke; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3374
+ if (cls === "transition-opacity") return `.${escapeSelector(cls)} { transition: opacity; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3375
+ if (cls === "transition-shadow") return `.${escapeSelector(cls)} { transition: box-shadow; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3376
+ if (cls === "transition-transform") return `.${escapeSelector(cls)} { transition: transform; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3246
3377
  const blurMatch = cls.match(/^blur(?:-(.+))?$/);
3247
3378
  if (blurMatch) {
3248
3379
  const blurMap = {
@@ -3256,7 +3387,7 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3256
3387
  "3xl": "64px"
3257
3388
  };
3258
3389
  const key = blurMatch[1] ?? "DEFAULT";
3259
- if (has4(blurMap, key)) return `.${cls} { filter: blur(${blurMap[key]}); }`;
3390
+ if (has3(blurMap, key)) return `.${escapeSelector(cls)} { filter: blur(${blurMap[key]}); }`;
3260
3391
  }
3261
3392
  const backdropBlurMatch = cls.match(/^backdrop-blur(?:-(.+))?$/);
3262
3393
  if (backdropBlurMatch) {
@@ -3271,7 +3402,7 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3271
3402
  "3xl": "64px"
3272
3403
  };
3273
3404
  const key = backdropBlurMatch[1] ?? "DEFAULT";
3274
- if (has4(blurMap, key)) return `.${cls} { backdrop-filter: blur(${blurMap[key]}); }`;
3405
+ if (has3(blurMap, key)) return `.${escapeSelector(cls)} { backdrop-filter: blur(${blurMap[key]}); }`;
3275
3406
  }
3276
3407
  const arbOpacityMatch = cls.match(/^opacity-\[(.+)\]$/);
3277
3408
  if (arbOpacityMatch) {
@@ -3400,6 +3531,9 @@ function generateUtilities(classes, config) {
3400
3531
  case "placeholder":
3401
3532
  selector += "::placeholder";
3402
3533
  break;
3534
+ case "file":
3535
+ selector += "::file-selector-button";
3536
+ break;
3403
3537
  case "group-hover":
3404
3538
  selector = `.group:hover ${selector}`;
3405
3539
  break;
@@ -3494,275 +3628,275 @@ function generateAliveSpecific(classes, _config) {
3494
3628
  ];
3495
3629
  if (aliveBasePrefixes.some((p) => cls === p || cls.startsWith(p + "-"))) continue;
3496
3630
  if (cls === "animate-none") {
3497
- rules.push(`.${cls} { animation: none; }`);
3631
+ rules.push(`.${escapeSelector(cls)} { animation: none; }`);
3498
3632
  continue;
3499
3633
  }
3500
3634
  if (cls === "animate-spin") {
3501
- rules.push(`.${cls} { animation: alive-spin 1s linear infinite; }`);
3635
+ rules.push(`.${escapeSelector(cls)} { animation: alive-spin 1s linear infinite; }`);
3502
3636
  continue;
3503
3637
  }
3504
3638
  if (cls === "animate-ping") {
3505
- rules.push(`.${cls} { animation: alive-ping 1s cubic-bezier(0,0,0.2,1) infinite; }`);
3639
+ rules.push(`.${escapeSelector(cls)} { animation: alive-ping 1s cubic-bezier(0,0,0.2,1) infinite; }`);
3506
3640
  continue;
3507
3641
  }
3508
3642
  if (cls === "animate-pulse") {
3509
- rules.push(`.${cls} { animation: alive-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }`);
3643
+ rules.push(`.${escapeSelector(cls)} { animation: alive-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }`);
3510
3644
  continue;
3511
3645
  }
3512
3646
  if (cls === "animate-bounce") {
3513
- rules.push(`.${cls} { animation: alive-bounce 1s infinite; }`);
3647
+ rules.push(`.${escapeSelector(cls)} { animation: alive-bounce 1s infinite; }`);
3514
3648
  continue;
3515
3649
  }
3516
3650
  if (cls === "animate-shimmer") {
3517
- rules.push(`.${cls} { animation: alive-shimmer 1.5s linear infinite; }`);
3651
+ rules.push(`.${escapeSelector(cls)} { animation: alive-shimmer 1.5s linear infinite; }`);
3518
3652
  continue;
3519
3653
  }
3520
3654
  if (cls === "ease-linear") {
3521
- rules.push(`.${cls} { transition-timing-function: linear; }`);
3655
+ rules.push(`.${escapeSelector(cls)} { transition-timing-function: linear; }`);
3522
3656
  continue;
3523
3657
  }
3524
3658
  if (cls === "ease-in") {
3525
- rules.push(`.${cls} { transition-timing-function: cubic-bezier(0.4,0,1,1); }`);
3659
+ rules.push(`.${escapeSelector(cls)} { transition-timing-function: cubic-bezier(0.4,0,1,1); }`);
3526
3660
  continue;
3527
3661
  }
3528
3662
  if (cls === "ease-out") {
3529
- rules.push(`.${cls} { transition-timing-function: cubic-bezier(0,0,0.2,1); }`);
3663
+ rules.push(`.${escapeSelector(cls)} { transition-timing-function: cubic-bezier(0,0,0.2,1); }`);
3530
3664
  continue;
3531
3665
  }
3532
3666
  if (cls === "ease-in-out") {
3533
- rules.push(`.${cls} { transition-timing-function: cubic-bezier(0.4,0,0.2,1); }`);
3667
+ rules.push(`.${escapeSelector(cls)} { transition-timing-function: cubic-bezier(0.4,0,0.2,1); }`);
3534
3668
  continue;
3535
3669
  }
3536
3670
  if (cls === "group") {
3537
- rules.push(`.${cls} {}`);
3671
+ rules.push(`.${escapeSelector(cls)} {}`);
3538
3672
  continue;
3539
3673
  }
3540
3674
  const staggerMatch = cls.match(/^stagger-(\d+)$/);
3541
3675
  if (staggerMatch) {
3542
- rules.push(`.${cls} { --alive-stagger-gap: ${staggerMatch[1]}ms; }`);
3676
+ rules.push(`.${escapeSelector(cls)} { --alive-stagger-gap: ${staggerMatch[1]}ms; }`);
3543
3677
  continue;
3544
3678
  }
3545
3679
  const indexMatch = cls.match(/^alive-index-(\d+)$/);
3546
3680
  if (indexMatch) {
3547
- rules.push(`.${cls} { --alive-index: ${indexMatch[1]}; }`);
3681
+ rules.push(`.${escapeSelector(cls)} { --alive-index: ${indexMatch[1]}; }`);
3548
3682
  continue;
3549
3683
  }
3550
3684
  const durationMatch = cls.match(/^duration-(\d+)$/);
3551
3685
  if (durationMatch) {
3552
- rules.push(`.${cls} { --alive-duration: ${durationMatch[1]}ms; }`);
3686
+ rules.push(`.${escapeSelector(cls)} { --alive-duration: ${durationMatch[1]}ms; }`);
3553
3687
  continue;
3554
3688
  }
3555
3689
  const delayMatch = cls.match(/^delay-(\d+)$/);
3556
3690
  if (delayMatch) {
3557
- rules.push(`.${cls} { animation-delay: ${delayMatch[1]}ms; }`);
3691
+ rules.push(`.${escapeSelector(cls)} { animation-delay: ${delayMatch[1]}ms; }`);
3558
3692
  continue;
3559
3693
  }
3560
3694
  const motionMsMatch = cls.match(/^motion-(\d+)$/);
3561
3695
  if (motionMsMatch) {
3562
- rules.push(`.${cls} { --alive-duration: ${motionMsMatch[1]}ms !important; }`);
3696
+ rules.push(`.${escapeSelector(cls)} { --alive-duration: ${motionMsMatch[1]}ms !important; }`);
3563
3697
  continue;
3564
3698
  }
3565
3699
  if (cls === "divide-x") {
3566
- rules.push(`.${cls} > * + * { border-left-width: 1px; border-left-style: solid; }`);
3700
+ rules.push(`.${escapeSelector(cls)}> * + * { border-left-width: 1px; border-left-style: solid; }`);
3567
3701
  continue;
3568
3702
  }
3569
3703
  if (cls === "divide-y") {
3570
- rules.push(`.${cls} > * + * { border-top-width: 1px; border-top-style: solid; }`);
3704
+ rules.push(`.${escapeSelector(cls)}> * + * { border-top-width: 1px; border-top-style: solid; }`);
3571
3705
  continue;
3572
3706
  }
3573
3707
  const divideColorMatch = cls.match(/^divide-([a-z]+)(?:-(\d+))?$/);
3574
3708
  if (divideColorMatch) {
3575
- rules.push(`.${cls} > * + * { border-color: inherit; }`);
3709
+ rules.push(`.${escapeSelector(cls)}> * + * { border-color: inherit; }`);
3576
3710
  continue;
3577
3711
  }
3578
3712
  if (cls === "appearance-none") {
3579
- rules.push(`.${cls} { appearance: none; }`);
3713
+ rules.push(`.${escapeSelector(cls)} { appearance: none; }`);
3580
3714
  continue;
3581
3715
  }
3582
3716
  if (cls === "appearance-auto") {
3583
- rules.push(`.${cls} { appearance: auto; }`);
3717
+ rules.push(`.${escapeSelector(cls)} { appearance: auto; }`);
3584
3718
  continue;
3585
3719
  }
3586
3720
  if (cls === "resize-none") {
3587
- rules.push(`.${cls} { resize: none; }`);
3721
+ rules.push(`.${escapeSelector(cls)} { resize: none; }`);
3588
3722
  continue;
3589
3723
  }
3590
3724
  if (cls === "resize") {
3591
- rules.push(`.${cls} { resize: both; }`);
3725
+ rules.push(`.${escapeSelector(cls)} { resize: both; }`);
3592
3726
  continue;
3593
3727
  }
3594
3728
  if (cls === "resize-y") {
3595
- rules.push(`.${cls} { resize: vertical; }`);
3729
+ rules.push(`.${escapeSelector(cls)} { resize: vertical; }`);
3596
3730
  continue;
3597
3731
  }
3598
3732
  if (cls === "resize-x") {
3599
- rules.push(`.${cls} { resize: horizontal; }`);
3733
+ rules.push(`.${escapeSelector(cls)} { resize: horizontal; }`);
3600
3734
  continue;
3601
3735
  }
3602
3736
  if (cls === "snap-none") {
3603
- rules.push(`.${cls} { scroll-snap-type: none; }`);
3737
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-type: none; }`);
3604
3738
  continue;
3605
3739
  }
3606
3740
  if (cls === "snap-x") {
3607
- rules.push(`.${cls} { scroll-snap-type: x mandatory; }`);
3741
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-type: x mandatory; }`);
3608
3742
  continue;
3609
3743
  }
3610
3744
  if (cls === "snap-y") {
3611
- rules.push(`.${cls} { scroll-snap-type: y mandatory; }`);
3745
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-type: y mandatory; }`);
3612
3746
  continue;
3613
3747
  }
3614
3748
  if (cls === "snap-start") {
3615
- rules.push(`.${cls} { scroll-snap-align: start; }`);
3749
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-align: start; }`);
3616
3750
  continue;
3617
3751
  }
3618
3752
  if (cls === "snap-center") {
3619
- rules.push(`.${cls} { scroll-snap-align: center; }`);
3753
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-align: center; }`);
3620
3754
  continue;
3621
3755
  }
3622
3756
  if (cls === "snap-end") {
3623
- rules.push(`.${cls} { scroll-snap-align: end; }`);
3757
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-align: end; }`);
3624
3758
  continue;
3625
3759
  }
3626
3760
  if (cls === "pointer-events-none") {
3627
- rules.push(`.${cls} { pointer-events: none; }`);
3761
+ rules.push(`.${escapeSelector(cls)} { pointer-events: none; }`);
3628
3762
  continue;
3629
3763
  }
3630
3764
  if (cls === "pointer-events-auto") {
3631
- rules.push(`.${cls} { pointer-events: auto; }`);
3765
+ rules.push(`.${escapeSelector(cls)} { pointer-events: auto; }`);
3632
3766
  continue;
3633
3767
  }
3634
3768
  if (cls === "sr-only") {
3635
- rules.push(`.${cls} { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }`);
3769
+ rules.push(`.${escapeSelector(cls)} { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0; }`);
3636
3770
  continue;
3637
3771
  }
3638
3772
  if (cls === "not-sr-only") {
3639
- rules.push(`.${cls} { position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; white-space: normal; }`);
3773
+ rules.push(`.${escapeSelector(cls)} { position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; white-space: normal; }`);
3640
3774
  continue;
3641
3775
  }
3642
3776
  if (cls === "will-change-auto") {
3643
- rules.push(`.${cls} { will-change: auto; }`);
3777
+ rules.push(`.${escapeSelector(cls)} { will-change: auto; }`);
3644
3778
  continue;
3645
3779
  }
3646
3780
  if (cls === "will-change-transform") {
3647
- rules.push(`.${cls} { will-change: transform; }`);
3781
+ rules.push(`.${escapeSelector(cls)} { will-change: transform; }`);
3648
3782
  continue;
3649
3783
  }
3650
3784
  if (cls === "will-change-opacity") {
3651
- rules.push(`.${cls} { will-change: opacity; }`);
3785
+ rules.push(`.${escapeSelector(cls)} { will-change: opacity; }`);
3652
3786
  continue;
3653
3787
  }
3654
3788
  const lineClampMatch = cls.match(/^line-clamp-(\d+)$/);
3655
3789
  if (lineClampMatch) {
3656
3790
  const n = lineClampMatch[1];
3657
- rules.push(`.${cls} { overflow: hidden; display: -webkit-box; -webkit-line-clamp: ${n}; -webkit-box-orient: vertical; }`);
3791
+ rules.push(`.${escapeSelector(cls)} { overflow: hidden; display: -webkit-box; -webkit-line-clamp: ${n}; -webkit-box-orient: vertical; }`);
3658
3792
  continue;
3659
3793
  }
3660
3794
  if (cls === "aspect-square") {
3661
- rules.push(`.${cls} { aspect-ratio: 1 / 1; }`);
3795
+ rules.push(`.${escapeSelector(cls)} { aspect-ratio: 1 / 1; }`);
3662
3796
  continue;
3663
3797
  }
3664
3798
  if (cls === "aspect-video") {
3665
- rules.push(`.${cls} { aspect-ratio: 16 / 9; }`);
3799
+ rules.push(`.${escapeSelector(cls)} { aspect-ratio: 16 / 9; }`);
3666
3800
  continue;
3667
3801
  }
3668
3802
  if (cls === "aspect-auto") {
3669
- rules.push(`.${cls} { aspect-ratio: auto; }`);
3803
+ rules.push(`.${escapeSelector(cls)} { aspect-ratio: auto; }`);
3670
3804
  continue;
3671
3805
  }
3672
3806
  if (cls === "object-contain") {
3673
- rules.push(`.${cls} { object-fit: contain; }`);
3807
+ rules.push(`.${escapeSelector(cls)} { object-fit: contain; }`);
3674
3808
  continue;
3675
3809
  }
3676
3810
  if (cls === "object-cover") {
3677
- rules.push(`.${cls} { object-fit: cover; }`);
3811
+ rules.push(`.${escapeSelector(cls)} { object-fit: cover; }`);
3678
3812
  continue;
3679
3813
  }
3680
3814
  if (cls === "object-fill") {
3681
- rules.push(`.${cls} { object-fit: fill; }`);
3815
+ rules.push(`.${escapeSelector(cls)} { object-fit: fill; }`);
3682
3816
  continue;
3683
3817
  }
3684
3818
  if (cls === "object-none") {
3685
- rules.push(`.${cls} { object-fit: none; }`);
3819
+ rules.push(`.${escapeSelector(cls)} { object-fit: none; }`);
3686
3820
  continue;
3687
3821
  }
3688
3822
  if (cls === "object-scale") {
3689
- rules.push(`.${cls} { object-fit: scale-down; }`);
3823
+ rules.push(`.${escapeSelector(cls)} { object-fit: scale-down; }`);
3690
3824
  continue;
3691
3825
  }
3692
3826
  if (cls === "mix-blend-multiply") {
3693
- rules.push(`.${cls} { mix-blend-mode: multiply; }`);
3827
+ rules.push(`.${escapeSelector(cls)} { mix-blend-mode: multiply; }`);
3694
3828
  continue;
3695
3829
  }
3696
3830
  if (cls === "mix-blend-screen") {
3697
- rules.push(`.${cls} { mix-blend-mode: screen; }`);
3831
+ rules.push(`.${escapeSelector(cls)} { mix-blend-mode: screen; }`);
3698
3832
  continue;
3699
3833
  }
3700
3834
  if (cls === "mix-blend-overlay") {
3701
- rules.push(`.${cls} { mix-blend-mode: overlay; }`);
3835
+ rules.push(`.${escapeSelector(cls)} { mix-blend-mode: overlay; }`);
3702
3836
  continue;
3703
3837
  }
3704
3838
  if (cls === "mix-blend-normal") {
3705
- rules.push(`.${cls} { mix-blend-mode: normal; }`);
3839
+ rules.push(`.${escapeSelector(cls)} { mix-blend-mode: normal; }`);
3706
3840
  continue;
3707
3841
  }
3708
3842
  if (cls === "isolate") {
3709
- rules.push(`.${cls} { isolation: isolate; }`);
3843
+ rules.push(`.${escapeSelector(cls)} { isolation: isolate; }`);
3710
3844
  continue;
3711
3845
  }
3712
3846
  if (cls === "isolation-auto") {
3713
- rules.push(`.${cls} { isolation: auto; }`);
3847
+ rules.push(`.${escapeSelector(cls)} { isolation: auto; }`);
3714
3848
  continue;
3715
3849
  }
3716
3850
  if (cls === "touch-auto") {
3717
- rules.push(`.${cls} { touch-action: auto; }`);
3851
+ rules.push(`.${escapeSelector(cls)} { touch-action: auto; }`);
3718
3852
  continue;
3719
3853
  }
3720
3854
  if (cls === "touch-none") {
3721
- rules.push(`.${cls} { touch-action: none; }`);
3855
+ rules.push(`.${escapeSelector(cls)} { touch-action: none; }`);
3722
3856
  continue;
3723
3857
  }
3724
3858
  if (cls === "touch-pan-x") {
3725
- rules.push(`.${cls} { touch-action: pan-x; }`);
3859
+ rules.push(`.${escapeSelector(cls)} { touch-action: pan-x; }`);
3726
3860
  continue;
3727
3861
  }
3728
3862
  if (cls === "touch-pan-y") {
3729
- rules.push(`.${cls} { touch-action: pan-y; }`);
3863
+ rules.push(`.${escapeSelector(cls)} { touch-action: pan-y; }`);
3730
3864
  continue;
3731
3865
  }
3732
3866
  if (cls === "touch-manipulation") {
3733
- rules.push(`.${cls} { touch-action: manipulation; }`);
3867
+ rules.push(`.${escapeSelector(cls)} { touch-action: manipulation; }`);
3734
3868
  continue;
3735
3869
  }
3736
3870
  if (cls === "select-none") {
3737
- rules.push(`.${cls} { user-select: none; }`);
3871
+ rules.push(`.${escapeSelector(cls)} { user-select: none; }`);
3738
3872
  continue;
3739
3873
  }
3740
3874
  if (cls === "select-text") {
3741
- rules.push(`.${cls} { user-select: text; }`);
3875
+ rules.push(`.${escapeSelector(cls)} { user-select: text; }`);
3742
3876
  continue;
3743
3877
  }
3744
3878
  if (cls === "select-all") {
3745
- rules.push(`.${cls} { user-select: all; }`);
3879
+ rules.push(`.${escapeSelector(cls)} { user-select: all; }`);
3746
3880
  continue;
3747
3881
  }
3748
3882
  if (cls === "select-auto") {
3749
- rules.push(`.${cls} { user-select: auto; }`);
3883
+ rules.push(`.${escapeSelector(cls)} { user-select: auto; }`);
3750
3884
  continue;
3751
3885
  }
3752
3886
  if (cls === "break-normal") {
3753
- rules.push(`.${cls} { overflow-wrap: normal; word-break: normal; }`);
3887
+ rules.push(`.${escapeSelector(cls)} { overflow-wrap: normal; word-break: normal; }`);
3754
3888
  continue;
3755
3889
  }
3756
3890
  if (cls === "break-words") {
3757
- rules.push(`.${cls} { overflow-wrap: break-word; }`);
3891
+ rules.push(`.${escapeSelector(cls)} { overflow-wrap: break-word; }`);
3758
3892
  continue;
3759
3893
  }
3760
3894
  if (cls === "break-all") {
3761
- rules.push(`.${cls} { word-break: break-all; }`);
3895
+ rules.push(`.${escapeSelector(cls)} { word-break: break-all; }`);
3762
3896
  continue;
3763
3897
  }
3764
3898
  if (cls === "break-keep") {
3765
- rules.push(`.${cls} { word-break: keep-all; }`);
3899
+ rules.push(`.${escapeSelector(cls)} { word-break: keep-all; }`);
3766
3900
  continue;
3767
3901
  }
3768
3902
  }