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