@alivecss/aliveui 1.0.1 → 1.0.3

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/vite.js CHANGED
@@ -2223,6 +2223,19 @@ function resolveColor(colors, name, shade) {
2223
2223
  if (!Object.prototype.hasOwnProperty.call(entry, shade)) return null;
2224
2224
  return entry[shade] ?? null;
2225
2225
  }
2226
+ function applyOpacity(value, opacity) {
2227
+ const alpha = +(opacity / 100).toFixed(3);
2228
+ const hexMatch = value.match(/^#([0-9a-fA-F]{3,6})$/);
2229
+ if (hexMatch) {
2230
+ let hex = hexMatch[1];
2231
+ if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
2232
+ const r = parseInt(hex.slice(0, 2), 16);
2233
+ const g = parseInt(hex.slice(2, 4), 16);
2234
+ const b = parseInt(hex.slice(4, 6), 16);
2235
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
2236
+ }
2237
+ return `color-mix(in srgb, ${value} ${opacity}%, transparent)`;
2238
+ }
2226
2239
  function parseVariants(cls) {
2227
2240
  const variants = [];
2228
2241
  let depth = 0;
@@ -2263,7 +2276,7 @@ function matchColor(cls, colors) {
2263
2276
  if (bgMatch) {
2264
2277
  const value = resolveColor(colors, bgMatch[1], bgMatch[2]);
2265
2278
  if (value) {
2266
- return `.${cls} {
2279
+ return `.${escapeSelector(cls)} {
2267
2280
  background-color: ${value};${transitioned("background-color")}
2268
2281
  }`;
2269
2282
  }
@@ -2272,7 +2285,7 @@ function matchColor(cls, colors) {
2272
2285
  if (textColorMatch) {
2273
2286
  const value = resolveColor(colors, textColorMatch[1], textColorMatch[2]);
2274
2287
  if (value) {
2275
- return `.${cls} {
2288
+ return `.${escapeSelector(cls)} {
2276
2289
  color: ${value};${transitioned("color")}
2277
2290
  }`;
2278
2291
  }
@@ -2281,7 +2294,7 @@ function matchColor(cls, colors) {
2281
2294
  if (borderColorMatch) {
2282
2295
  const value = resolveColor(colors, borderColorMatch[1], borderColorMatch[2]);
2283
2296
  if (value) {
2284
- return `.${cls} {
2297
+ return `.${escapeSelector(cls)} {
2285
2298
  border-color: ${value};${transitioned("border-color")}
2286
2299
  }`;
2287
2300
  }
@@ -2290,7 +2303,7 @@ function matchColor(cls, colors) {
2290
2303
  if (ringColorMatch) {
2291
2304
  const value = resolveColor(colors, ringColorMatch[1], ringColorMatch[2]);
2292
2305
  if (value) {
2293
- return `.${cls} {
2306
+ return `.${escapeSelector(cls)} {
2294
2307
  --alive-ring-color: ${value};
2295
2308
  }`;
2296
2309
  }
@@ -2299,7 +2312,7 @@ function matchColor(cls, colors) {
2299
2312
  if (outlineColorMatch) {
2300
2313
  const value = resolveColor(colors, outlineColorMatch[1], outlineColorMatch[2]);
2301
2314
  if (value) {
2302
- return `.${cls} {
2315
+ return `.${escapeSelector(cls)} {
2303
2316
  outline-color: ${value};
2304
2317
  }`;
2305
2318
  }
@@ -2308,7 +2321,7 @@ function matchColor(cls, colors) {
2308
2321
  if (fillMatch) {
2309
2322
  const value = resolveColor(colors, fillMatch[1], fillMatch[2]);
2310
2323
  if (value) {
2311
- return `.${cls} {
2324
+ return `.${escapeSelector(cls)} {
2312
2325
  fill: ${value};
2313
2326
  }`;
2314
2327
  }
@@ -2317,7 +2330,7 @@ function matchColor(cls, colors) {
2317
2330
  if (strokeMatch) {
2318
2331
  const value = resolveColor(colors, strokeMatch[1], strokeMatch[2]);
2319
2332
  if (value) {
2320
- return `.${cls} {
2333
+ return `.${escapeSelector(cls)} {
2321
2334
  stroke: ${value};
2322
2335
  }`;
2323
2336
  }
@@ -2326,7 +2339,7 @@ function matchColor(cls, colors) {
2326
2339
  if (decorationMatch) {
2327
2340
  const value = resolveColor(colors, decorationMatch[1], decorationMatch[2]);
2328
2341
  if (value) {
2329
- return `.${cls} {
2342
+ return `.${escapeSelector(cls)} {
2330
2343
  text-decoration-color: ${value};
2331
2344
  }`;
2332
2345
  }
@@ -2335,7 +2348,7 @@ function matchColor(cls, colors) {
2335
2348
  if (caretMatch) {
2336
2349
  const value = resolveColor(colors, caretMatch[1], caretMatch[2]);
2337
2350
  if (value) {
2338
- return `.${cls} {
2351
+ return `.${escapeSelector(cls)} {
2339
2352
  caret-color: ${value};
2340
2353
  }`;
2341
2354
  }
@@ -2344,7 +2357,7 @@ function matchColor(cls, colors) {
2344
2357
  if (accentMatch) {
2345
2358
  const value = resolveColor(colors, accentMatch[1], accentMatch[2]);
2346
2359
  if (value) {
2347
- return `.${cls} {
2360
+ return `.${escapeSelector(cls)} {
2348
2361
  accent-color: ${value};
2349
2362
  }`;
2350
2363
  }
@@ -2353,49 +2366,72 @@ function matchColor(cls, colors) {
2353
2366
  if (shadowColorMatch) {
2354
2367
  const value = resolveColor(colors, shadowColorMatch[1], shadowColorMatch[2]);
2355
2368
  if (value) {
2356
- return `.${cls} {
2369
+ return `.${escapeSelector(cls)} {
2357
2370
  --alive-shadow-color: ${value};
2358
2371
  }`;
2359
2372
  }
2360
2373
  }
2361
- const arbBgMatch = cls.match(/^bg-\[(.+)\]$/);
2374
+ const arbBgMatch = cls.match(/^bg-\[(.+)\](?:\/(\d+))?$/);
2362
2375
  if (arbBgMatch) {
2363
- const val = arbBgMatch[1];
2376
+ const [, val, opStr] = arbBgMatch;
2364
2377
  const escaped = escapeSelector(cls);
2365
2378
  if (val.startsWith("url(") || val.startsWith("linear-gradient") || val.startsWith("radial-gradient")) {
2366
2379
  return `.${escaped} {
2367
2380
  background-image: ${val};${transitioned("background-image")}
2368
2381
  }`;
2369
2382
  }
2383
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2370
2384
  return `.${escaped} {
2371
- background-color: ${val};${transitioned("background-color")}
2385
+ background-color: ${colorVal};${transitioned("background-color")}
2372
2386
  }`;
2373
2387
  }
2374
- const arbTextMatch = cls.match(/^text-\[(.+)\]$/);
2388
+ const arbTextMatch = cls.match(/^text-\[(.+)\](?:\/(\d+))?$/);
2375
2389
  if (arbTextMatch) {
2390
+ const [, val, opStr] = arbTextMatch;
2391
+ 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);
2392
+ if (isSizeValue) {
2393
+ return `.${escapeSelector(cls)} {
2394
+ font-size: ${val};
2395
+ }`;
2396
+ }
2397
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2376
2398
  return `.${escapeSelector(cls)} {
2377
- color: ${arbTextMatch[1]};${transitioned("color")}
2399
+ color: ${colorVal};${transitioned("color")}
2378
2400
  }`;
2379
2401
  }
2380
- const arbBorderColorMatch = cls.match(/^border-\[#[0-9a-fA-F]|^border-\[rgb|^border-\[hsl|^border-\[oklch/);
2402
+ const arbBorderColorMatch = cls.match(/^border-\[(.+)\](?:\/(\d+))?$/);
2381
2403
  if (arbBorderColorMatch) {
2382
- const m = cls.match(/^border-\[(.+)\]$/);
2383
- if (m) {
2404
+ const [, val, opStr] = arbBorderColorMatch;
2405
+ const looksLikeColor = val.startsWith("#") || val.startsWith("rgb") || val.startsWith("hsl") || val.startsWith("oklch") || val.startsWith("var(") || val === "transparent" || val === "currentColor";
2406
+ if (looksLikeColor) {
2407
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2384
2408
  return `.${escapeSelector(cls)} {
2385
- border-color: ${m[1]};${transitioned("border-color")}
2409
+ border-color: ${colorVal};${transitioned("border-color")}
2386
2410
  }`;
2387
2411
  }
2388
2412
  }
2389
- const arbFillMatch = cls.match(/^fill-\[(.+)\]$/);
2413
+ const arbRingColorMatch = cls.match(/^ring-\[(.+)\](?:\/(\d+))?$/);
2414
+ if (arbRingColorMatch) {
2415
+ const [, val, opStr] = arbRingColorMatch;
2416
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2417
+ return `.${escapeSelector(cls)} {
2418
+ --alive-ring-color: ${colorVal};
2419
+ }`;
2420
+ }
2421
+ const arbFillMatch = cls.match(/^fill-\[(.+)\](?:\/(\d+))?$/);
2390
2422
  if (arbFillMatch) {
2423
+ const [, val, opStr] = arbFillMatch;
2424
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2391
2425
  return `.${escapeSelector(cls)} {
2392
- fill: ${arbFillMatch[1]};
2426
+ fill: ${colorVal};
2393
2427
  }`;
2394
2428
  }
2395
- const arbStrokeMatch = cls.match(/^stroke-\[(.+)\]$/);
2429
+ const arbStrokeMatch = cls.match(/^stroke-\[(.+)\](?:\/(\d+))?$/);
2396
2430
  if (arbStrokeMatch) {
2431
+ const [, val, opStr] = arbStrokeMatch;
2432
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2397
2433
  return `.${escapeSelector(cls)} {
2398
- stroke: ${arbStrokeMatch[1]};
2434
+ stroke: ${colorVal};
2399
2435
  }`;
2400
2436
  }
2401
2437
  return null;
@@ -2428,182 +2464,182 @@ function has(obj, key) {
2428
2464
  function matchSpacing(cls, spacing) {
2429
2465
  const pMatch = cls.match(/^p-(.+)$/);
2430
2466
  if (pMatch && has(spacing, pMatch[1])) {
2431
- return `.${cls} { padding: ${spacing[pMatch[1]]}; }`;
2467
+ return `.${escapeSelector(cls)} { padding: ${spacing[pMatch[1]]}; }`;
2432
2468
  }
2433
2469
  const pxMatch = cls.match(/^px-(.+)$/);
2434
2470
  if (pxMatch && has(spacing, pxMatch[1])) {
2435
- return `.${cls} { padding-left: ${spacing[pxMatch[1]]}; padding-right: ${spacing[pxMatch[1]]}; }`;
2471
+ return `.${escapeSelector(cls)} { padding-left: ${spacing[pxMatch[1]]}; padding-right: ${spacing[pxMatch[1]]}; }`;
2436
2472
  }
2437
2473
  const pyMatch = cls.match(/^py-(.+)$/);
2438
2474
  if (pyMatch && has(spacing, pyMatch[1])) {
2439
- return `.${cls} { padding-top: ${spacing[pyMatch[1]]}; padding-bottom: ${spacing[pyMatch[1]]}; }`;
2475
+ return `.${escapeSelector(cls)} { padding-top: ${spacing[pyMatch[1]]}; padding-bottom: ${spacing[pyMatch[1]]}; }`;
2440
2476
  }
2441
2477
  const ptMatch = cls.match(/^pt-(.+)$/);
2442
2478
  if (ptMatch && has(spacing, ptMatch[1])) {
2443
- return `.${cls} { padding-top: ${spacing[ptMatch[1]]}; }`;
2479
+ return `.${escapeSelector(cls)} { padding-top: ${spacing[ptMatch[1]]}; }`;
2444
2480
  }
2445
2481
  const prMatch = cls.match(/^pr-(.+)$/);
2446
2482
  if (prMatch && has(spacing, prMatch[1])) {
2447
- return `.${cls} { padding-right: ${spacing[prMatch[1]]}; }`;
2483
+ return `.${escapeSelector(cls)} { padding-right: ${spacing[prMatch[1]]}; }`;
2448
2484
  }
2449
2485
  const pbMatch = cls.match(/^pb-(.+)$/);
2450
2486
  if (pbMatch && has(spacing, pbMatch[1])) {
2451
- return `.${cls} { padding-bottom: ${spacing[pbMatch[1]]}; }`;
2487
+ return `.${escapeSelector(cls)} { padding-bottom: ${spacing[pbMatch[1]]}; }`;
2452
2488
  }
2453
2489
  const plMatch = cls.match(/^pl-(.+)$/);
2454
2490
  if (plMatch && has(spacing, plMatch[1])) {
2455
- return `.${cls} { padding-left: ${spacing[plMatch[1]]}; }`;
2491
+ return `.${escapeSelector(cls)} { padding-left: ${spacing[plMatch[1]]}; }`;
2456
2492
  }
2457
2493
  const mMatch = cls.match(/^m-(.+)$/);
2458
2494
  if (mMatch) {
2459
- if (mMatch[1] === "auto") return `.${cls} { margin: auto; }`;
2460
- if (has(spacing, mMatch[1])) return `.${cls} { margin: ${spacing[mMatch[1]]}; }`;
2495
+ if (mMatch[1] === "auto") return `.${escapeSelector(cls)} { margin: auto; }`;
2496
+ if (has(spacing, mMatch[1])) return `.${escapeSelector(cls)} { margin: ${spacing[mMatch[1]]}; }`;
2461
2497
  }
2462
2498
  const mxMatch = cls.match(/^mx-(.+)$/);
2463
2499
  if (mxMatch) {
2464
- if (mxMatch[1] === "auto") return `.${cls} { margin-left: auto; margin-right: auto; }`;
2465
- if (has(spacing, mxMatch[1])) return `.${cls} { margin-left: ${spacing[mxMatch[1]]}; margin-right: ${spacing[mxMatch[1]]}; }`;
2500
+ if (mxMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-left: auto; margin-right: auto; }`;
2501
+ if (has(spacing, mxMatch[1])) return `.${escapeSelector(cls)} { margin-left: ${spacing[mxMatch[1]]}; margin-right: ${spacing[mxMatch[1]]}; }`;
2466
2502
  }
2467
2503
  const myMatch = cls.match(/^my-(.+)$/);
2468
2504
  if (myMatch) {
2469
- if (myMatch[1] === "auto") return `.${cls} { margin-top: auto; margin-bottom: auto; }`;
2470
- if (has(spacing, myMatch[1])) return `.${cls} { margin-top: ${spacing[myMatch[1]]}; margin-bottom: ${spacing[myMatch[1]]}; }`;
2505
+ if (myMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-top: auto; margin-bottom: auto; }`;
2506
+ if (has(spacing, myMatch[1])) return `.${escapeSelector(cls)} { margin-top: ${spacing[myMatch[1]]}; margin-bottom: ${spacing[myMatch[1]]}; }`;
2471
2507
  }
2472
2508
  const mtMatch = cls.match(/^mt-(.+)$/);
2473
2509
  if (mtMatch) {
2474
- if (mtMatch[1] === "auto") return `.${cls} { margin-top: auto; }`;
2475
- if (has(spacing, mtMatch[1])) return `.${cls} { margin-top: ${spacing[mtMatch[1]]}; }`;
2510
+ if (mtMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-top: auto; }`;
2511
+ if (has(spacing, mtMatch[1])) return `.${escapeSelector(cls)} { margin-top: ${spacing[mtMatch[1]]}; }`;
2476
2512
  }
2477
2513
  const mrMatch = cls.match(/^mr-(.+)$/);
2478
2514
  if (mrMatch) {
2479
- if (mrMatch[1] === "auto") return `.${cls} { margin-right: auto; }`;
2480
- if (has(spacing, mrMatch[1])) return `.${cls} { margin-right: ${spacing[mrMatch[1]]}; }`;
2515
+ if (mrMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-right: auto; }`;
2516
+ if (has(spacing, mrMatch[1])) return `.${escapeSelector(cls)} { margin-right: ${spacing[mrMatch[1]]}; }`;
2481
2517
  }
2482
2518
  const mbMatch = cls.match(/^mb-(.+)$/);
2483
2519
  if (mbMatch) {
2484
- if (mbMatch[1] === "auto") return `.${cls} { margin-bottom: auto; }`;
2485
- if (has(spacing, mbMatch[1])) return `.${cls} { margin-bottom: ${spacing[mbMatch[1]]}; }`;
2520
+ if (mbMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-bottom: auto; }`;
2521
+ if (has(spacing, mbMatch[1])) return `.${escapeSelector(cls)} { margin-bottom: ${spacing[mbMatch[1]]}; }`;
2486
2522
  }
2487
2523
  const mlMatch = cls.match(/^ml-(.+)$/);
2488
2524
  if (mlMatch) {
2489
- if (mlMatch[1] === "auto") return `.${cls} { margin-left: auto; }`;
2490
- if (has(spacing, mlMatch[1])) return `.${cls} { margin-left: ${spacing[mlMatch[1]]}; }`;
2525
+ if (mlMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-left: auto; }`;
2526
+ if (has(spacing, mlMatch[1])) return `.${escapeSelector(cls)} { margin-left: ${spacing[mlMatch[1]]}; }`;
2491
2527
  }
2492
2528
  const gapMatch = cls.match(/^gap-(.+)$/);
2493
2529
  if (gapMatch && has(spacing, gapMatch[1])) {
2494
- return `.${cls} { gap: ${spacing[gapMatch[1]]}; }`;
2530
+ return `.${escapeSelector(cls)} { gap: ${spacing[gapMatch[1]]}; }`;
2495
2531
  }
2496
2532
  const gapXMatch = cls.match(/^gap-x-(.+)$/);
2497
2533
  if (gapXMatch && has(spacing, gapXMatch[1])) {
2498
- return `.${cls} { column-gap: ${spacing[gapXMatch[1]]}; }`;
2534
+ return `.${escapeSelector(cls)} { column-gap: ${spacing[gapXMatch[1]]}; }`;
2499
2535
  }
2500
2536
  const gapYMatch = cls.match(/^gap-y-(.+)$/);
2501
2537
  if (gapYMatch && has(spacing, gapYMatch[1])) {
2502
- return `.${cls} { row-gap: ${spacing[gapYMatch[1]]}; }`;
2538
+ return `.${escapeSelector(cls)} { row-gap: ${spacing[gapYMatch[1]]}; }`;
2503
2539
  }
2504
2540
  const spaceXMatch = cls.match(/^space-x-(.+)$/);
2505
2541
  if (spaceXMatch && has(spacing, spaceXMatch[1])) {
2506
- return `.${cls} > * + * { margin-left: ${spacing[spaceXMatch[1]]}; }`;
2542
+ return `.${escapeSelector(cls)}> * + * { margin-left: ${spacing[spaceXMatch[1]]}; }`;
2507
2543
  }
2508
2544
  const spaceYMatch = cls.match(/^space-y-(.+)$/);
2509
2545
  if (spaceYMatch && has(spacing, spaceYMatch[1])) {
2510
- return `.${cls} > * + * { margin-top: ${spacing[spaceYMatch[1]]}; }`;
2546
+ return `.${escapeSelector(cls)}> * + * { margin-top: ${spacing[spaceYMatch[1]]}; }`;
2511
2547
  }
2512
2548
  const insetMatch = cls.match(/^inset-(.+)$/);
2513
2549
  if (insetMatch) {
2514
- if (insetMatch[1] === "auto") return `.${cls} { inset: auto; }`;
2515
- if (insetMatch[1] === "0") return `.${cls} { inset: 0px; }`;
2516
- if (has(spacing, insetMatch[1])) return `.${cls} { inset: ${spacing[insetMatch[1]]}; }`;
2550
+ if (insetMatch[1] === "auto") return `.${escapeSelector(cls)} { inset: auto; }`;
2551
+ if (insetMatch[1] === "0") return `.${escapeSelector(cls)} { inset: 0px; }`;
2552
+ if (has(spacing, insetMatch[1])) return `.${escapeSelector(cls)} { inset: ${spacing[insetMatch[1]]}; }`;
2517
2553
  }
2518
2554
  const insetXMatch = cls.match(/^inset-x-(.+)$/);
2519
2555
  if (insetXMatch) {
2520
2556
  const val = insetXMatch[1] === "auto" ? "auto" : insetXMatch[1] === "0" ? "0px" : has(spacing, insetXMatch[1]) ? spacing[insetXMatch[1]] : void 0;
2521
- if (val) return `.${cls} { left: ${val}; right: ${val}; }`;
2557
+ if (val) return `.${escapeSelector(cls)} { left: ${val}; right: ${val}; }`;
2522
2558
  }
2523
2559
  const insetYMatch = cls.match(/^inset-y-(.+)$/);
2524
2560
  if (insetYMatch) {
2525
2561
  const val = insetYMatch[1] === "auto" ? "auto" : insetYMatch[1] === "0" ? "0px" : has(spacing, insetYMatch[1]) ? spacing[insetYMatch[1]] : void 0;
2526
- if (val) return `.${cls} { top: ${val}; bottom: ${val}; }`;
2562
+ if (val) return `.${escapeSelector(cls)} { top: ${val}; bottom: ${val}; }`;
2527
2563
  }
2528
2564
  const topMatch = cls.match(/^top-(.+)$/);
2529
2565
  if (topMatch) {
2530
- if (topMatch[1] === "auto") return `.${cls} { top: auto; }`;
2531
- if (topMatch[1] === "0") return `.${cls} { top: 0px; }`;
2532
- if (has(spacing, topMatch[1])) return `.${cls} { top: ${spacing[topMatch[1]]}; }`;
2566
+ if (topMatch[1] === "auto") return `.${escapeSelector(cls)} { top: auto; }`;
2567
+ if (topMatch[1] === "0") return `.${escapeSelector(cls)} { top: 0px; }`;
2568
+ if (has(spacing, topMatch[1])) return `.${escapeSelector(cls)} { top: ${spacing[topMatch[1]]}; }`;
2533
2569
  }
2534
2570
  const rightMatch = cls.match(/^right-(.+)$/);
2535
2571
  if (rightMatch) {
2536
- if (rightMatch[1] === "auto") return `.${cls} { right: auto; }`;
2537
- if (rightMatch[1] === "0") return `.${cls} { right: 0px; }`;
2538
- if (has(spacing, rightMatch[1])) return `.${cls} { right: ${spacing[rightMatch[1]]}; }`;
2572
+ if (rightMatch[1] === "auto") return `.${escapeSelector(cls)} { right: auto; }`;
2573
+ if (rightMatch[1] === "0") return `.${escapeSelector(cls)} { right: 0px; }`;
2574
+ if (has(spacing, rightMatch[1])) return `.${escapeSelector(cls)} { right: ${spacing[rightMatch[1]]}; }`;
2539
2575
  }
2540
2576
  const bottomMatch = cls.match(/^bottom-(.+)$/);
2541
2577
  if (bottomMatch) {
2542
- if (bottomMatch[1] === "auto") return `.${cls} { bottom: auto; }`;
2543
- if (bottomMatch[1] === "0") return `.${cls} { bottom: 0px; }`;
2544
- if (has(spacing, bottomMatch[1])) return `.${cls} { bottom: ${spacing[bottomMatch[1]]}; }`;
2578
+ if (bottomMatch[1] === "auto") return `.${escapeSelector(cls)} { bottom: auto; }`;
2579
+ if (bottomMatch[1] === "0") return `.${escapeSelector(cls)} { bottom: 0px; }`;
2580
+ if (has(spacing, bottomMatch[1])) return `.${escapeSelector(cls)} { bottom: ${spacing[bottomMatch[1]]}; }`;
2545
2581
  }
2546
2582
  const leftMatch = cls.match(/^left-(.+)$/);
2547
2583
  if (leftMatch) {
2548
- if (leftMatch[1] === "auto") return `.${cls} { left: auto; }`;
2549
- if (leftMatch[1] === "0") return `.${cls} { left: 0px; }`;
2550
- if (has(spacing, leftMatch[1])) return `.${cls} { left: ${spacing[leftMatch[1]]}; }`;
2584
+ if (leftMatch[1] === "auto") return `.${escapeSelector(cls)} { left: auto; }`;
2585
+ if (leftMatch[1] === "0") return `.${escapeSelector(cls)} { left: 0px; }`;
2586
+ if (has(spacing, leftMatch[1])) return `.${escapeSelector(cls)} { left: ${spacing[leftMatch[1]]}; }`;
2551
2587
  }
2552
2588
  const negMMatch = cls.match(/^-m-(.+)$/);
2553
2589
  if (negMMatch && has(spacing, negMMatch[1])) {
2554
- return `.\\-m-${negMMatch[1]} { margin: -${spacing[negMMatch[1]]}; }`;
2590
+ return `.${escapeSelector(cls)} { margin: -${spacing[negMMatch[1]]}; }`;
2555
2591
  }
2556
2592
  const negMxMatch = cls.match(/^-mx-(.+)$/);
2557
2593
  if (negMxMatch && has(spacing, negMxMatch[1])) {
2558
- return `.\\-mx-${negMxMatch[1]} { margin-left: -${spacing[negMxMatch[1]]}; margin-right: -${spacing[negMxMatch[1]]}; }`;
2594
+ return `.${escapeSelector(cls)} { margin-left: -${spacing[negMxMatch[1]]}; margin-right: -${spacing[negMxMatch[1]]}; }`;
2559
2595
  }
2560
2596
  const negMyMatch = cls.match(/^-my-(.+)$/);
2561
2597
  if (negMyMatch && has(spacing, negMyMatch[1])) {
2562
- return `.\\-my-${negMyMatch[1]} { margin-top: -${spacing[negMyMatch[1]]}; margin-bottom: -${spacing[negMyMatch[1]]}; }`;
2598
+ return `.${escapeSelector(cls)} { margin-top: -${spacing[negMyMatch[1]]}; margin-bottom: -${spacing[negMyMatch[1]]}; }`;
2563
2599
  }
2564
2600
  const negMtMatch = cls.match(/^-mt-(.+)$/);
2565
2601
  if (negMtMatch && has(spacing, negMtMatch[1])) {
2566
- return `.\\-mt-${negMtMatch[1]} { margin-top: -${spacing[negMtMatch[1]]}; }`;
2602
+ return `.${escapeSelector(cls)} { margin-top: -${spacing[negMtMatch[1]]}; }`;
2567
2603
  }
2568
2604
  const negMrMatch = cls.match(/^-mr-(.+)$/);
2569
2605
  if (negMrMatch && has(spacing, negMrMatch[1])) {
2570
- return `.\\-mr-${negMrMatch[1]} { margin-right: -${spacing[negMrMatch[1]]}; }`;
2606
+ return `.${escapeSelector(cls)} { margin-right: -${spacing[negMrMatch[1]]}; }`;
2571
2607
  }
2572
2608
  const negMbMatch = cls.match(/^-mb-(.+)$/);
2573
2609
  if (negMbMatch && has(spacing, negMbMatch[1])) {
2574
- return `.\\-mb-${negMbMatch[1]} { margin-bottom: -${spacing[negMbMatch[1]]}; }`;
2610
+ return `.${escapeSelector(cls)} { margin-bottom: -${spacing[negMbMatch[1]]}; }`;
2575
2611
  }
2576
2612
  const negMlMatch = cls.match(/^-ml-(.+)$/);
2577
2613
  if (negMlMatch && has(spacing, negMlMatch[1])) {
2578
- return `.\\-ml-${negMlMatch[1]} { margin-left: -${spacing[negMlMatch[1]]}; }`;
2614
+ return `.${escapeSelector(cls)} { margin-left: -${spacing[negMlMatch[1]]}; }`;
2579
2615
  }
2580
2616
  const negInsetMatch = cls.match(/^-inset-(.+)$/);
2581
2617
  if (negInsetMatch && has(spacing, negInsetMatch[1])) {
2582
- return `.\\-inset-${negInsetMatch[1]} { inset: -${spacing[negInsetMatch[1]]}; }`;
2618
+ return `.${escapeSelector(cls)} { inset: -${spacing[negInsetMatch[1]]}; }`;
2583
2619
  }
2584
2620
  const negInsetXMatch = cls.match(/^-inset-x-(.+)$/);
2585
2621
  if (negInsetXMatch && has(spacing, negInsetXMatch[1])) {
2586
- return `.\\-inset-x-${negInsetXMatch[1]} { left: -${spacing[negInsetXMatch[1]]}; right: -${spacing[negInsetXMatch[1]]}; }`;
2622
+ return `.${escapeSelector(cls)} { left: -${spacing[negInsetXMatch[1]]}; right: -${spacing[negInsetXMatch[1]]}; }`;
2587
2623
  }
2588
2624
  const negInsetYMatch = cls.match(/^-inset-y-(.+)$/);
2589
2625
  if (negInsetYMatch && has(spacing, negInsetYMatch[1])) {
2590
- return `.\\-inset-y-${negInsetYMatch[1]} { top: -${spacing[negInsetYMatch[1]]}; bottom: -${spacing[negInsetYMatch[1]]}; }`;
2626
+ return `.${escapeSelector(cls)} { top: -${spacing[negInsetYMatch[1]]}; bottom: -${spacing[negInsetYMatch[1]]}; }`;
2591
2627
  }
2592
2628
  const negTopMatch = cls.match(/^-top-(.+)$/);
2593
2629
  if (negTopMatch && has(spacing, negTopMatch[1])) {
2594
- return `.\\-top-${negTopMatch[1]} { top: -${spacing[negTopMatch[1]]}; }`;
2630
+ return `.${escapeSelector(cls)} { top: -${spacing[negTopMatch[1]]}; }`;
2595
2631
  }
2596
2632
  const negRightMatch = cls.match(/^-right-(.+)$/);
2597
2633
  if (negRightMatch && has(spacing, negRightMatch[1])) {
2598
- return `.\\-right-${negRightMatch[1]} { right: -${spacing[negRightMatch[1]]}; }`;
2634
+ return `.${escapeSelector(cls)} { right: -${spacing[negRightMatch[1]]}; }`;
2599
2635
  }
2600
2636
  const negBottomMatch = cls.match(/^-bottom-(.+)$/);
2601
2637
  if (negBottomMatch && has(spacing, negBottomMatch[1])) {
2602
- return `.\\-bottom-${negBottomMatch[1]} { bottom: -${spacing[negBottomMatch[1]]}; }`;
2638
+ return `.${escapeSelector(cls)} { bottom: -${spacing[negBottomMatch[1]]}; }`;
2603
2639
  }
2604
2640
  const negLeftMatch = cls.match(/^-left-(.+)$/);
2605
2641
  if (negLeftMatch && has(spacing, negLeftMatch[1])) {
2606
- return `.\\-left-${negLeftMatch[1]} { left: -${spacing[negLeftMatch[1]]}; }`;
2642
+ return `.${escapeSelector(cls)} { left: -${spacing[negLeftMatch[1]]}; }`;
2607
2643
  }
2608
2644
  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)-\[(.+)\]$/);
2609
2645
  if (arbSpacingMatch) {
@@ -2690,21 +2726,21 @@ function matchTypography(cls, fontSize, fontWeight, lineHeight) {
2690
2726
  const textSizeMatch = cls.match(/^text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/);
2691
2727
  if (textSizeMatch && hasOwn(fontSize, textSizeMatch[1])) {
2692
2728
  const [size, lh] = fontSize[textSizeMatch[1]];
2693
- return `.${cls} {
2729
+ return `.${escapeSelector(cls)} {
2694
2730
  font-size: ${size};
2695
2731
  line-height: ${lh};
2696
2732
  }`;
2697
2733
  }
2698
2734
  const fontWeightMatch = cls.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)$/);
2699
2735
  if (fontWeightMatch && hasOwn(fontWeight, fontWeightMatch[1])) {
2700
- return `.${cls} { font-weight: ${fontWeight[fontWeightMatch[1]]}; }`;
2736
+ return `.${escapeSelector(cls)} { font-weight: ${fontWeight[fontWeightMatch[1]]}; }`;
2701
2737
  }
2702
- if (cls === "font-sans") return `.${cls} { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }`;
2703
- if (cls === "font-serif") return `.${cls} { font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; }`;
2704
- if (cls === "font-mono") return `.${cls} { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }`;
2738
+ if (cls === "font-sans") return `.${escapeSelector(cls)} { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }`;
2739
+ if (cls === "font-serif") return `.${escapeSelector(cls)} { font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; }`;
2740
+ if (cls === "font-mono") return `.${escapeSelector(cls)} { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }`;
2705
2741
  const leadingMatch = cls.match(/^leading-(.+)$/);
2706
2742
  if (leadingMatch && hasOwn(lineHeight, leadingMatch[1])) {
2707
- return `.${cls} { line-height: ${lineHeight[leadingMatch[1]]}; }`;
2743
+ return `.${escapeSelector(cls)} { line-height: ${lineHeight[leadingMatch[1]]}; }`;
2708
2744
  }
2709
2745
  const trackingMap = {
2710
2746
  tighter: "-0.05em",
@@ -2716,47 +2752,48 @@ function matchTypography(cls, fontSize, fontWeight, lineHeight) {
2716
2752
  };
2717
2753
  const trackingMatch = cls.match(/^tracking-(.+)$/);
2718
2754
  if (trackingMatch && Object.prototype.hasOwnProperty.call(trackingMap, trackingMatch[1])) {
2719
- return `.${cls} { letter-spacing: ${trackingMap[trackingMatch[1]]}; }`;
2720
- }
2721
- if (cls === "text-left") return `.${cls} { text-align: left; }`;
2722
- if (cls === "text-center") return `.${cls} { text-align: center; }`;
2723
- if (cls === "text-right") return `.${cls} { text-align: right; }`;
2724
- if (cls === "text-justify") return `.${cls} { text-align: justify; }`;
2725
- if (cls === "text-start") return `.${cls} { text-align: start; }`;
2726
- if (cls === "text-end") return `.${cls} { text-align: end; }`;
2727
- if (cls === "uppercase") return `.${cls} { text-transform: uppercase; }`;
2728
- if (cls === "lowercase") return `.${cls} { text-transform: lowercase; }`;
2729
- if (cls === "capitalize") return `.${cls} { text-transform: capitalize; }`;
2730
- if (cls === "normal-case") return `.${cls} { text-transform: none; }`;
2731
- if (cls === "underline") return `.${cls} { text-decoration-line: underline; }`;
2732
- if (cls === "overline") return `.${cls} { text-decoration-line: overline; }`;
2733
- if (cls === "line-through") return `.${cls} { text-decoration-line: line-through; }`;
2734
- if (cls === "no-underline") return `.${cls} { text-decoration-line: none; }`;
2735
- if (cls === "truncate") return `.${cls} { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }`;
2736
- if (cls === "text-ellipsis") return `.${cls} { text-overflow: ellipsis; }`;
2737
- if (cls === "text-clip") return `.${cls} { text-overflow: clip; }`;
2738
- if (cls === "whitespace-normal") return `.${cls} { white-space: normal; }`;
2739
- if (cls === "whitespace-nowrap") return `.${cls} { white-space: nowrap; }`;
2740
- if (cls === "whitespace-pre") return `.${cls} { white-space: pre; }`;
2741
- if (cls === "whitespace-pre-line") return `.${cls} { white-space: pre-line; }`;
2742
- if (cls === "whitespace-pre-wrap") return `.${cls} { white-space: pre-wrap; }`;
2743
- if (cls === "whitespace-break-spaces") return `.${cls} { white-space: break-spaces; }`;
2744
- if (cls === "italic") return `.${cls} { font-style: italic; }`;
2745
- if (cls === "not-italic") return `.${cls} { font-style: normal; }`;
2746
- if (cls === "tabular-nums") return `.${cls} { font-variant-numeric: tabular-nums; }`;
2747
- if (cls === "oldstyle-nums") return `.${cls} { font-variant-numeric: oldstyle-nums; }`;
2748
- if (cls === "list-none") return `.${cls} { list-style-type: none; }`;
2749
- if (cls === "list-disc") return `.${cls} { list-style-type: disc; }`;
2750
- if (cls === "list-decimal") return `.${cls} { list-style-type: decimal; }`;
2751
- if (cls === "break-normal") return `.${cls} { overflow-wrap: normal; word-break: normal; }`;
2752
- if (cls === "break-words") return `.${cls} { overflow-wrap: break-word; }`;
2753
- if (cls === "break-all") return `.${cls} { word-break: break-all; }`;
2754
- if (cls === "break-keep") return `.${cls} { word-break: keep-all; }`;
2755
+ return `.${escapeSelector(cls)} { letter-spacing: ${trackingMap[trackingMatch[1]]}; }`;
2756
+ }
2757
+ if (cls === "text-left") return `.${escapeSelector(cls)} { text-align: left; }`;
2758
+ if (cls === "text-center") return `.${escapeSelector(cls)} { text-align: center; }`;
2759
+ if (cls === "text-right") return `.${escapeSelector(cls)} { text-align: right; }`;
2760
+ if (cls === "text-justify") return `.${escapeSelector(cls)} { text-align: justify; }`;
2761
+ if (cls === "text-start") return `.${escapeSelector(cls)} { text-align: start; }`;
2762
+ if (cls === "text-end") return `.${escapeSelector(cls)} { text-align: end; }`;
2763
+ if (cls === "uppercase") return `.${escapeSelector(cls)} { text-transform: uppercase; }`;
2764
+ if (cls === "lowercase") return `.${escapeSelector(cls)} { text-transform: lowercase; }`;
2765
+ if (cls === "capitalize") return `.${escapeSelector(cls)} { text-transform: capitalize; }`;
2766
+ if (cls === "normal-case") return `.${escapeSelector(cls)} { text-transform: none; }`;
2767
+ if (cls === "underline") return `.${escapeSelector(cls)} { text-decoration-line: underline; }`;
2768
+ if (cls === "overline") return `.${escapeSelector(cls)} { text-decoration-line: overline; }`;
2769
+ if (cls === "line-through") return `.${escapeSelector(cls)} { text-decoration-line: line-through; }`;
2770
+ if (cls === "no-underline") return `.${escapeSelector(cls)} { text-decoration-line: none; }`;
2771
+ if (cls === "truncate") return `.${escapeSelector(cls)} { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }`;
2772
+ if (cls === "text-ellipsis") return `.${escapeSelector(cls)} { text-overflow: ellipsis; }`;
2773
+ if (cls === "text-clip") return `.${escapeSelector(cls)} { text-overflow: clip; }`;
2774
+ if (cls === "whitespace-normal") return `.${escapeSelector(cls)} { white-space: normal; }`;
2775
+ if (cls === "whitespace-nowrap") return `.${escapeSelector(cls)} { white-space: nowrap; }`;
2776
+ if (cls === "whitespace-pre") return `.${escapeSelector(cls)} { white-space: pre; }`;
2777
+ if (cls === "whitespace-pre-line") return `.${escapeSelector(cls)} { white-space: pre-line; }`;
2778
+ if (cls === "whitespace-pre-wrap") return `.${escapeSelector(cls)} { white-space: pre-wrap; }`;
2779
+ if (cls === "whitespace-break-spaces") return `.${escapeSelector(cls)} { white-space: break-spaces; }`;
2780
+ if (cls === "italic") return `.${escapeSelector(cls)} { font-style: italic; }`;
2781
+ if (cls === "not-italic") return `.${escapeSelector(cls)} { font-style: normal; }`;
2782
+ if (cls === "tabular-nums") return `.${escapeSelector(cls)} { font-variant-numeric: tabular-nums; }`;
2783
+ if (cls === "oldstyle-nums") return `.${escapeSelector(cls)} { font-variant-numeric: oldstyle-nums; }`;
2784
+ if (cls === "list-none") return `.${escapeSelector(cls)} { list-style-type: none; }`;
2785
+ if (cls === "list-disc") return `.${escapeSelector(cls)} { list-style-type: disc; }`;
2786
+ if (cls === "list-decimal") return `.${escapeSelector(cls)} { list-style-type: decimal; }`;
2787
+ if (cls === "break-normal") return `.${escapeSelector(cls)} { overflow-wrap: normal; word-break: normal; }`;
2788
+ if (cls === "break-words") return `.${escapeSelector(cls)} { overflow-wrap: break-word; }`;
2789
+ if (cls === "break-all") return `.${escapeSelector(cls)} { word-break: break-all; }`;
2790
+ if (cls === "break-keep") return `.${escapeSelector(cls)} { word-break: keep-all; }`;
2755
2791
  return null;
2756
2792
  }
2757
2793
  var init_typography = __esm({
2758
2794
  "src/generator/typography.ts"() {
2759
2795
  "use strict";
2796
+ init_utils();
2760
2797
  }
2761
2798
  });
2762
2799
 
@@ -2782,7 +2819,7 @@ function matchLayout(cls) {
2782
2819
  hidden: "display: none;",
2783
2820
  contents: "display: contents;"
2784
2821
  };
2785
- if (displayMap[cls]) return `.${cls} { ${displayMap[cls]} }`;
2822
+ if (displayMap[cls]) return `.${escapeSelector(cls)} { ${displayMap[cls]} }`;
2786
2823
  const posMap = {
2787
2824
  static: "position: static;",
2788
2825
  relative: "position: relative;",
@@ -2790,111 +2827,115 @@ function matchLayout(cls) {
2790
2827
  fixed: "position: fixed;",
2791
2828
  sticky: "position: sticky;"
2792
2829
  };
2793
- if (posMap[cls]) return `.${cls} { ${posMap[cls]} }`;
2794
- if (cls === "flex-row") return `.${cls} { flex-direction: row; }`;
2795
- if (cls === "flex-row-reverse") return `.${cls} { flex-direction: row-reverse; }`;
2796
- if (cls === "flex-col") return `.${cls} { flex-direction: column; }`;
2797
- if (cls === "flex-col-reverse") return `.${cls} { flex-direction: column-reverse; }`;
2798
- if (cls === "flex-wrap") return `.${cls} { flex-wrap: wrap; }`;
2799
- if (cls === "flex-nowrap") return `.${cls} { flex-wrap: nowrap; }`;
2800
- if (cls === "flex-wrap-reverse") return `.${cls} { flex-wrap: wrap-reverse; }`;
2801
- if (cls === "flex-1") return `.${cls} { flex: 1 1 0%; }`;
2802
- if (cls === "flex-auto") return `.${cls} { flex: 1 1 auto; }`;
2803
- if (cls === "flex-initial") return `.${cls} { flex: 0 1 auto; }`;
2804
- if (cls === "flex-none") return `.${cls} { flex: none; }`;
2805
- if (cls === "flex-grow") return `.${cls} { flex-grow: 1; }`;
2806
- if (cls === "flex-grow-0") return `.${cls} { flex-grow: 0; }`;
2807
- if (cls === "flex-shrink") return `.${cls} { flex-shrink: 1; }`;
2808
- if (cls === "flex-shrink-0") return `.${cls} { flex-shrink: 0; }`;
2809
- if (cls === "items-start") return `.${cls} { align-items: flex-start; }`;
2810
- if (cls === "items-end") return `.${cls} { align-items: flex-end; }`;
2811
- if (cls === "items-center") return `.${cls} { align-items: center; }`;
2812
- if (cls === "items-baseline") return `.${cls} { align-items: baseline; }`;
2813
- if (cls === "items-stretch") return `.${cls} { align-items: stretch; }`;
2814
- if (cls === "self-auto") return `.${cls} { align-self: auto; }`;
2815
- if (cls === "self-start") return `.${cls} { align-self: flex-start; }`;
2816
- if (cls === "self-end") return `.${cls} { align-self: flex-end; }`;
2817
- if (cls === "self-center") return `.${cls} { align-self: center; }`;
2818
- if (cls === "self-stretch") return `.${cls} { align-self: stretch; }`;
2819
- if (cls === "self-baseline") return `.${cls} { align-self: baseline; }`;
2820
- if (cls === "justify-start") return `.${cls} { justify-content: flex-start; }`;
2821
- if (cls === "justify-end") return `.${cls} { justify-content: flex-end; }`;
2822
- if (cls === "justify-center") return `.${cls} { justify-content: center; }`;
2823
- if (cls === "justify-between") return `.${cls} { justify-content: space-between; }`;
2824
- if (cls === "justify-around") return `.${cls} { justify-content: space-around; }`;
2825
- if (cls === "justify-evenly") return `.${cls} { justify-content: space-evenly; }`;
2826
- if (cls === "justify-stretch") return `.${cls} { justify-content: stretch; }`;
2827
- if (cls === "justify-items-start") return `.${cls} { justify-items: start; }`;
2828
- if (cls === "justify-items-end") return `.${cls} { justify-items: end; }`;
2829
- if (cls === "justify-items-center") return `.${cls} { justify-items: center; }`;
2830
- if (cls === "justify-items-stretch") return `.${cls} { justify-items: stretch; }`;
2831
- if (cls === "justify-self-auto") return `.${cls} { justify-self: auto; }`;
2832
- if (cls === "justify-self-start") return `.${cls} { justify-self: start; }`;
2833
- if (cls === "justify-self-end") return `.${cls} { justify-self: end; }`;
2834
- if (cls === "justify-self-center") return `.${cls} { justify-self: center; }`;
2835
- if (cls === "justify-self-stretch") return `.${cls} { justify-self: stretch; }`;
2836
- if (cls === "content-normal") return `.${cls} { align-content: normal; }`;
2837
- if (cls === "content-center") return `.${cls} { align-content: center; }`;
2838
- if (cls === "content-start") return `.${cls} { align-content: flex-start; }`;
2839
- if (cls === "content-end") return `.${cls} { align-content: flex-end; }`;
2840
- if (cls === "content-between") return `.${cls} { align-content: space-between; }`;
2841
- if (cls === "content-around") return `.${cls} { align-content: space-around; }`;
2842
- if (cls === "content-evenly") return `.${cls} { align-content: space-evenly; }`;
2843
- if (cls === "content-stretch") return `.${cls} { align-content: stretch; }`;
2844
- if (cls === "content-baseline") return `.${cls} { align-content: baseline; }`;
2830
+ if (posMap[cls]) return `.${escapeSelector(cls)} { ${posMap[cls]} }`;
2831
+ if (cls === "flex-row") return `.${escapeSelector(cls)} { flex-direction: row; }`;
2832
+ if (cls === "flex-row-reverse") return `.${escapeSelector(cls)} { flex-direction: row-reverse; }`;
2833
+ if (cls === "flex-col") return `.${escapeSelector(cls)} { flex-direction: column; }`;
2834
+ if (cls === "flex-col-reverse") return `.${escapeSelector(cls)} { flex-direction: column-reverse; }`;
2835
+ if (cls === "flex-wrap") return `.${escapeSelector(cls)} { flex-wrap: wrap; }`;
2836
+ if (cls === "flex-nowrap") return `.${escapeSelector(cls)} { flex-wrap: nowrap; }`;
2837
+ if (cls === "flex-wrap-reverse") return `.${escapeSelector(cls)} { flex-wrap: wrap-reverse; }`;
2838
+ if (cls === "flex-1") return `.${escapeSelector(cls)} { flex: 1 1 0%; }`;
2839
+ if (cls === "flex-auto") return `.${escapeSelector(cls)} { flex: 1 1 auto; }`;
2840
+ if (cls === "flex-initial") return `.${escapeSelector(cls)} { flex: 0 1 auto; }`;
2841
+ if (cls === "flex-none") return `.${escapeSelector(cls)} { flex: none; }`;
2842
+ if (cls === "flex-grow") return `.${escapeSelector(cls)} { flex-grow: 1; }`;
2843
+ if (cls === "flex-grow-0") return `.${escapeSelector(cls)} { flex-grow: 0; }`;
2844
+ if (cls === "flex-shrink") return `.${escapeSelector(cls)} { flex-shrink: 1; }`;
2845
+ if (cls === "flex-shrink-0") return `.${escapeSelector(cls)} { flex-shrink: 0; }`;
2846
+ if (cls === "grow") return `.${escapeSelector(cls)} { flex-grow: 1; }`;
2847
+ if (cls === "grow-0") return `.${escapeSelector(cls)} { flex-grow: 0; }`;
2848
+ if (cls === "shrink") return `.${escapeSelector(cls)} { flex-shrink: 1; }`;
2849
+ if (cls === "shrink-0") return `.${escapeSelector(cls)} { flex-shrink: 0; }`;
2850
+ if (cls === "items-start") return `.${escapeSelector(cls)} { align-items: flex-start; }`;
2851
+ if (cls === "items-end") return `.${escapeSelector(cls)} { align-items: flex-end; }`;
2852
+ if (cls === "items-center") return `.${escapeSelector(cls)} { align-items: center; }`;
2853
+ if (cls === "items-baseline") return `.${escapeSelector(cls)} { align-items: baseline; }`;
2854
+ if (cls === "items-stretch") return `.${escapeSelector(cls)} { align-items: stretch; }`;
2855
+ if (cls === "self-auto") return `.${escapeSelector(cls)} { align-self: auto; }`;
2856
+ if (cls === "self-start") return `.${escapeSelector(cls)} { align-self: flex-start; }`;
2857
+ if (cls === "self-end") return `.${escapeSelector(cls)} { align-self: flex-end; }`;
2858
+ if (cls === "self-center") return `.${escapeSelector(cls)} { align-self: center; }`;
2859
+ if (cls === "self-stretch") return `.${escapeSelector(cls)} { align-self: stretch; }`;
2860
+ if (cls === "self-baseline") return `.${escapeSelector(cls)} { align-self: baseline; }`;
2861
+ if (cls === "justify-start") return `.${escapeSelector(cls)} { justify-content: flex-start; }`;
2862
+ if (cls === "justify-end") return `.${escapeSelector(cls)} { justify-content: flex-end; }`;
2863
+ if (cls === "justify-center") return `.${escapeSelector(cls)} { justify-content: center; }`;
2864
+ if (cls === "justify-between") return `.${escapeSelector(cls)} { justify-content: space-between; }`;
2865
+ if (cls === "justify-around") return `.${escapeSelector(cls)} { justify-content: space-around; }`;
2866
+ if (cls === "justify-evenly") return `.${escapeSelector(cls)} { justify-content: space-evenly; }`;
2867
+ if (cls === "justify-stretch") return `.${escapeSelector(cls)} { justify-content: stretch; }`;
2868
+ if (cls === "justify-items-start") return `.${escapeSelector(cls)} { justify-items: start; }`;
2869
+ if (cls === "justify-items-end") return `.${escapeSelector(cls)} { justify-items: end; }`;
2870
+ if (cls === "justify-items-center") return `.${escapeSelector(cls)} { justify-items: center; }`;
2871
+ if (cls === "justify-items-stretch") return `.${escapeSelector(cls)} { justify-items: stretch; }`;
2872
+ if (cls === "justify-self-auto") return `.${escapeSelector(cls)} { justify-self: auto; }`;
2873
+ if (cls === "justify-self-start") return `.${escapeSelector(cls)} { justify-self: start; }`;
2874
+ if (cls === "justify-self-end") return `.${escapeSelector(cls)} { justify-self: end; }`;
2875
+ if (cls === "justify-self-center") return `.${escapeSelector(cls)} { justify-self: center; }`;
2876
+ if (cls === "justify-self-stretch") return `.${escapeSelector(cls)} { justify-self: stretch; }`;
2877
+ if (cls === "content-normal") return `.${escapeSelector(cls)} { align-content: normal; }`;
2878
+ if (cls === "content-center") return `.${escapeSelector(cls)} { align-content: center; }`;
2879
+ if (cls === "content-start") return `.${escapeSelector(cls)} { align-content: flex-start; }`;
2880
+ if (cls === "content-end") return `.${escapeSelector(cls)} { align-content: flex-end; }`;
2881
+ if (cls === "content-between") return `.${escapeSelector(cls)} { align-content: space-between; }`;
2882
+ if (cls === "content-around") return `.${escapeSelector(cls)} { align-content: space-around; }`;
2883
+ if (cls === "content-evenly") return `.${escapeSelector(cls)} { align-content: space-evenly; }`;
2884
+ if (cls === "content-stretch") return `.${escapeSelector(cls)} { align-content: stretch; }`;
2885
+ if (cls === "content-baseline") return `.${escapeSelector(cls)} { align-content: baseline; }`;
2845
2886
  const gridColsMatch = cls.match(/^grid-cols-(\d+)$/);
2846
2887
  if (gridColsMatch) {
2847
2888
  const n = parseInt(gridColsMatch[1]);
2848
- return `.${cls} { grid-template-columns: repeat(${n}, minmax(0, 1fr)); }`;
2889
+ return `.${escapeSelector(cls)} { grid-template-columns: repeat(${n}, minmax(0, 1fr)); }`;
2849
2890
  }
2850
- if (cls === "grid-cols-none") return `.${cls} { grid-template-columns: none; }`;
2891
+ if (cls === "grid-cols-none") return `.${escapeSelector(cls)} { grid-template-columns: none; }`;
2851
2892
  const gridRowsMatch = cls.match(/^grid-rows-(\d+)$/);
2852
2893
  if (gridRowsMatch) {
2853
2894
  const n = parseInt(gridRowsMatch[1]);
2854
- return `.${cls} { grid-template-rows: repeat(${n}, minmax(0, 1fr)); }`;
2895
+ return `.${escapeSelector(cls)} { grid-template-rows: repeat(${n}, minmax(0, 1fr)); }`;
2855
2896
  }
2856
- if (cls === "grid-rows-none") return `.${cls} { grid-template-rows: none; }`;
2897
+ if (cls === "grid-rows-none") return `.${escapeSelector(cls)} { grid-template-rows: none; }`;
2857
2898
  const colSpanMatch = cls.match(/^col-span-(\d+)$/);
2858
- if (colSpanMatch) return `.${cls} { grid-column: span ${colSpanMatch[1]} / span ${colSpanMatch[1]}; }`;
2859
- if (cls === "col-span-full") return `.${cls} { grid-column: 1 / -1; }`;
2860
- if (cls === "col-auto") return `.${cls} { grid-column: auto; }`;
2899
+ if (colSpanMatch) return `.${escapeSelector(cls)} { grid-column: span ${colSpanMatch[1]} / span ${colSpanMatch[1]}; }`;
2900
+ if (cls === "col-span-full") return `.${escapeSelector(cls)} { grid-column: 1 / -1; }`;
2901
+ if (cls === "col-auto") return `.${escapeSelector(cls)} { grid-column: auto; }`;
2861
2902
  const rowSpanMatch = cls.match(/^row-span-(\d+)$/);
2862
- if (rowSpanMatch) return `.${cls} { grid-row: span ${rowSpanMatch[1]} / span ${rowSpanMatch[1]}; }`;
2863
- if (cls === "row-span-full") return `.${cls} { grid-row: 1 / -1; }`;
2864
- if (cls === "row-auto") return `.${cls} { grid-row: auto; }`;
2903
+ if (rowSpanMatch) return `.${escapeSelector(cls)} { grid-row: span ${rowSpanMatch[1]} / span ${rowSpanMatch[1]}; }`;
2904
+ if (cls === "row-span-full") return `.${escapeSelector(cls)} { grid-row: 1 / -1; }`;
2905
+ if (cls === "row-auto") return `.${escapeSelector(cls)} { grid-row: auto; }`;
2865
2906
  const colStartMatch = cls.match(/^col-start-(\d+)$/);
2866
- if (colStartMatch) return `.${cls} { grid-column-start: ${colStartMatch[1]}; }`;
2907
+ if (colStartMatch) return `.${escapeSelector(cls)} { grid-column-start: ${colStartMatch[1]}; }`;
2867
2908
  const colEndMatch = cls.match(/^col-end-(\d+)$/);
2868
- if (colEndMatch) return `.${cls} { grid-column-end: ${colEndMatch[1]}; }`;
2909
+ if (colEndMatch) return `.${escapeSelector(cls)} { grid-column-end: ${colEndMatch[1]}; }`;
2869
2910
  const rowStartMatch = cls.match(/^row-start-(\d+)$/);
2870
- if (rowStartMatch) return `.${cls} { grid-row-start: ${rowStartMatch[1]}; }`;
2911
+ if (rowStartMatch) return `.${escapeSelector(cls)} { grid-row-start: ${rowStartMatch[1]}; }`;
2871
2912
  const rowEndMatch = cls.match(/^row-end-(\d+)$/);
2872
- if (rowEndMatch) return `.${cls} { grid-row-end: ${rowEndMatch[1]}; }`;
2913
+ if (rowEndMatch) return `.${escapeSelector(cls)} { grid-row-end: ${rowEndMatch[1]}; }`;
2873
2914
  const orderMatch = cls.match(/^order-(-?\d+)$/);
2874
- if (orderMatch) return `.${cls} { order: ${orderMatch[1]}; }`;
2875
- if (cls === "order-first") return `.${cls} { order: -9999; }`;
2876
- if (cls === "order-last") return `.${cls} { order: 9999; }`;
2877
- if (cls === "order-none") return `.${cls} { order: 0; }`;
2878
- if (cls === "float-right") return `.${cls} { float: right; }`;
2879
- if (cls === "float-left") return `.${cls} { float: left; }`;
2880
- if (cls === "float-none") return `.${cls} { float: none; }`;
2915
+ if (orderMatch) return `.${escapeSelector(cls)} { order: ${orderMatch[1]}; }`;
2916
+ if (cls === "order-first") return `.${escapeSelector(cls)} { order: -9999; }`;
2917
+ if (cls === "order-last") return `.${escapeSelector(cls)} { order: 9999; }`;
2918
+ if (cls === "order-none") return `.${escapeSelector(cls)} { order: 0; }`;
2919
+ if (cls === "float-right") return `.${escapeSelector(cls)} { float: right; }`;
2920
+ if (cls === "float-left") return `.${escapeSelector(cls)} { float: left; }`;
2921
+ if (cls === "float-none") return `.${escapeSelector(cls)} { float: none; }`;
2881
2922
  if (cls === "clearfix") return `.${cls}::after { content: ""; display: table; clear: both; }`;
2882
- if (cls === "overflow-auto") return `.${cls} { overflow: auto; }`;
2883
- if (cls === "overflow-hidden") return `.${cls} { overflow: hidden; }`;
2884
- if (cls === "overflow-clip") return `.${cls} { overflow: clip; }`;
2885
- if (cls === "overflow-visible") return `.${cls} { overflow: visible; }`;
2886
- if (cls === "overflow-scroll") return `.${cls} { overflow: scroll; }`;
2887
- if (cls === "overflow-x-auto") return `.${cls} { overflow-x: auto; }`;
2888
- if (cls === "overflow-x-hidden") return `.${cls} { overflow-x: hidden; }`;
2889
- if (cls === "overflow-x-scroll") return `.${cls} { overflow-x: scroll; }`;
2890
- if (cls === "overflow-y-auto") return `.${cls} { overflow-y: auto; }`;
2891
- if (cls === "overflow-y-hidden") return `.${cls} { overflow-y: hidden; }`;
2892
- if (cls === "overflow-y-scroll") return `.${cls} { overflow-y: scroll; }`;
2893
- if (cls === "visible") return `.${cls} { visibility: visible; }`;
2894
- if (cls === "invisible") return `.${cls} { visibility: hidden; }`;
2895
- if (cls === "collapse") return `.${cls} { visibility: collapse; }`;
2896
- if (cls === "pointer-events-none") return `.${cls} { pointer-events: none; }`;
2897
- if (cls === "pointer-events-auto") return `.${cls} { pointer-events: auto; }`;
2923
+ if (cls === "overflow-auto") return `.${escapeSelector(cls)} { overflow: auto; }`;
2924
+ if (cls === "overflow-hidden") return `.${escapeSelector(cls)} { overflow: hidden; }`;
2925
+ if (cls === "overflow-clip") return `.${escapeSelector(cls)} { overflow: clip; }`;
2926
+ if (cls === "overflow-visible") return `.${escapeSelector(cls)} { overflow: visible; }`;
2927
+ if (cls === "overflow-scroll") return `.${escapeSelector(cls)} { overflow: scroll; }`;
2928
+ if (cls === "overflow-x-auto") return `.${escapeSelector(cls)} { overflow-x: auto; }`;
2929
+ if (cls === "overflow-x-hidden") return `.${escapeSelector(cls)} { overflow-x: hidden; }`;
2930
+ if (cls === "overflow-x-scroll") return `.${escapeSelector(cls)} { overflow-x: scroll; }`;
2931
+ if (cls === "overflow-y-auto") return `.${escapeSelector(cls)} { overflow-y: auto; }`;
2932
+ if (cls === "overflow-y-hidden") return `.${escapeSelector(cls)} { overflow-y: hidden; }`;
2933
+ if (cls === "overflow-y-scroll") return `.${escapeSelector(cls)} { overflow-y: scroll; }`;
2934
+ if (cls === "visible") return `.${escapeSelector(cls)} { visibility: visible; }`;
2935
+ if (cls === "invisible") return `.${escapeSelector(cls)} { visibility: hidden; }`;
2936
+ if (cls === "collapse") return `.${escapeSelector(cls)} { visibility: collapse; }`;
2937
+ if (cls === "pointer-events-none") return `.${escapeSelector(cls)} { pointer-events: none; }`;
2938
+ if (cls === "pointer-events-auto") return `.${escapeSelector(cls)} { pointer-events: auto; }`;
2898
2939
  const cursorMap = {
2899
2940
  "cursor-auto": "auto",
2900
2941
  "cursor-default": "default",
@@ -2911,30 +2952,30 @@ function matchLayout(cls) {
2911
2952
  "cursor-zoom-in": "zoom-in",
2912
2953
  "cursor-zoom-out": "zoom-out"
2913
2954
  };
2914
- if (cursorMap[cls]) return `.${cls} { cursor: ${cursorMap[cls]}; }`;
2915
- if (cls === "select-none") return `.${cls} { user-select: none; }`;
2916
- if (cls === "select-text") return `.${cls} { user-select: text; }`;
2917
- if (cls === "select-all") return `.${cls} { user-select: all; }`;
2918
- if (cls === "select-auto") return `.${cls} { user-select: auto; }`;
2919
- if (cls === "object-contain") return `.${cls} { object-fit: contain; }`;
2920
- if (cls === "object-cover") return `.${cls} { object-fit: cover; }`;
2921
- if (cls === "object-fill") return `.${cls} { object-fit: fill; }`;
2922
- if (cls === "object-none") return `.${cls} { object-fit: none; }`;
2923
- if (cls === "object-scale-down") return `.${cls} { object-fit: scale-down; }`;
2924
- if (cls === "aspect-auto") return `.${cls} { aspect-ratio: auto; }`;
2925
- if (cls === "aspect-square") return `.${cls} { aspect-ratio: 1 / 1; }`;
2926
- if (cls === "aspect-video") return `.${cls} { aspect-ratio: 16 / 9; }`;
2955
+ if (cursorMap[cls]) return `.${escapeSelector(cls)} { cursor: ${cursorMap[cls]}; }`;
2956
+ if (cls === "select-none") return `.${escapeSelector(cls)} { user-select: none; }`;
2957
+ if (cls === "select-text") return `.${escapeSelector(cls)} { user-select: text; }`;
2958
+ if (cls === "select-all") return `.${escapeSelector(cls)} { user-select: all; }`;
2959
+ if (cls === "select-auto") return `.${escapeSelector(cls)} { user-select: auto; }`;
2960
+ if (cls === "object-contain") return `.${escapeSelector(cls)} { object-fit: contain; }`;
2961
+ if (cls === "object-cover") return `.${escapeSelector(cls)} { object-fit: cover; }`;
2962
+ if (cls === "object-fill") return `.${escapeSelector(cls)} { object-fit: fill; }`;
2963
+ if (cls === "object-none") return `.${escapeSelector(cls)} { object-fit: none; }`;
2964
+ if (cls === "object-scale-down") return `.${escapeSelector(cls)} { object-fit: scale-down; }`;
2965
+ if (cls === "aspect-auto") return `.${escapeSelector(cls)} { aspect-ratio: auto; }`;
2966
+ if (cls === "aspect-square") return `.${escapeSelector(cls)} { aspect-ratio: 1 / 1; }`;
2967
+ if (cls === "aspect-video") return `.${escapeSelector(cls)} { aspect-ratio: 16 / 9; }`;
2927
2968
  if (cls === "container") {
2928
- return `.${cls} {
2969
+ return `.${escapeSelector(cls)} {
2929
2970
  width: 100%;
2930
2971
  margin-left: auto;
2931
2972
  margin-right: auto;
2932
2973
  }`;
2933
2974
  }
2934
- if (cls === "box-border") return `.${cls} { box-sizing: border-box; }`;
2935
- if (cls === "box-content") return `.${cls} { box-sizing: content-box; }`;
2936
- if (cls === "isolate") return `.${cls} { isolation: isolate; }`;
2937
- if (cls === "isolation-auto") return `.${cls} { isolation: auto; }`;
2975
+ if (cls === "box-border") return `.${escapeSelector(cls)} { box-sizing: border-box; }`;
2976
+ if (cls === "box-content") return `.${escapeSelector(cls)} { box-sizing: content-box; }`;
2977
+ if (cls === "isolate") return `.${escapeSelector(cls)} { isolation: isolate; }`;
2978
+ if (cls === "isolation-auto") return `.${escapeSelector(cls)} { isolation: auto; }`;
2938
2979
  const mixBlendMap = {
2939
2980
  "mix-blend-normal": "normal",
2940
2981
  "mix-blend-multiply": "multiply",
@@ -2949,40 +2990,41 @@ function matchLayout(cls) {
2949
2990
  "mix-blend-difference": "difference",
2950
2991
  "mix-blend-exclusion": "exclusion"
2951
2992
  };
2952
- if (mixBlendMap[cls]) return `.${cls} { mix-blend-mode: ${mixBlendMap[cls]}; }`;
2953
- if (cls === "bg-auto") return `.${cls} { background-size: auto; }`;
2954
- if (cls === "bg-cover") return `.${cls} { background-size: cover; }`;
2955
- if (cls === "bg-contain") return `.${cls} { background-size: contain; }`;
2956
- if (cls === "bg-center") return `.${cls} { background-position: center; }`;
2957
- if (cls === "bg-top") return `.${cls} { background-position: top; }`;
2958
- if (cls === "bg-bottom") return `.${cls} { background-position: bottom; }`;
2959
- if (cls === "bg-left") return `.${cls} { background-position: left; }`;
2960
- if (cls === "bg-right") return `.${cls} { background-position: right; }`;
2961
- if (cls === "bg-left-top") return `.${cls} { background-position: left top; }`;
2962
- if (cls === "bg-left-bottom") return `.${cls} { background-position: left bottom; }`;
2963
- if (cls === "bg-right-top") return `.${cls} { background-position: right top; }`;
2964
- if (cls === "bg-right-bottom") return `.${cls} { background-position: right bottom; }`;
2965
- if (cls === "bg-repeat") return `.${cls} { background-repeat: repeat; }`;
2966
- if (cls === "bg-no-repeat") return `.${cls} { background-repeat: no-repeat; }`;
2967
- if (cls === "bg-repeat-x") return `.${cls} { background-repeat: repeat-x; }`;
2968
- if (cls === "bg-repeat-y") return `.${cls} { background-repeat: repeat-y; }`;
2969
- if (cls === "bg-repeat-round") return `.${cls} { background-repeat: round; }`;
2970
- if (cls === "bg-repeat-space") return `.${cls} { background-repeat: space; }`;
2971
- if (cls === "bg-fixed") return `.${cls} { background-attachment: fixed; }`;
2972
- if (cls === "bg-local") return `.${cls} { background-attachment: local; }`;
2973
- if (cls === "bg-scroll") return `.${cls} { background-attachment: scroll; }`;
2974
- if (cls === "bg-origin-border") return `.${cls} { background-origin: border-box; }`;
2975
- if (cls === "bg-origin-padding") return `.${cls} { background-origin: padding-box; }`;
2976
- if (cls === "bg-origin-content") return `.${cls} { background-origin: content-box; }`;
2977
- if (cls === "bg-clip-border") return `.${cls} { background-clip: border-box; }`;
2978
- if (cls === "bg-clip-padding") return `.${cls} { background-clip: padding-box; }`;
2979
- if (cls === "bg-clip-content") return `.${cls} { background-clip: content-box; }`;
2980
- if (cls === "bg-clip-text") return `.${cls} { background-clip: text; -webkit-background-clip: text; }`;
2993
+ if (mixBlendMap[cls]) return `.${escapeSelector(cls)} { mix-blend-mode: ${mixBlendMap[cls]}; }`;
2994
+ if (cls === "bg-auto") return `.${escapeSelector(cls)} { background-size: auto; }`;
2995
+ if (cls === "bg-cover") return `.${escapeSelector(cls)} { background-size: cover; }`;
2996
+ if (cls === "bg-contain") return `.${escapeSelector(cls)} { background-size: contain; }`;
2997
+ if (cls === "bg-center") return `.${escapeSelector(cls)} { background-position: center; }`;
2998
+ if (cls === "bg-top") return `.${escapeSelector(cls)} { background-position: top; }`;
2999
+ if (cls === "bg-bottom") return `.${escapeSelector(cls)} { background-position: bottom; }`;
3000
+ if (cls === "bg-left") return `.${escapeSelector(cls)} { background-position: left; }`;
3001
+ if (cls === "bg-right") return `.${escapeSelector(cls)} { background-position: right; }`;
3002
+ if (cls === "bg-left-top") return `.${escapeSelector(cls)} { background-position: left top; }`;
3003
+ if (cls === "bg-left-bottom") return `.${escapeSelector(cls)} { background-position: left bottom; }`;
3004
+ if (cls === "bg-right-top") return `.${escapeSelector(cls)} { background-position: right top; }`;
3005
+ if (cls === "bg-right-bottom") return `.${escapeSelector(cls)} { background-position: right bottom; }`;
3006
+ if (cls === "bg-repeat") return `.${escapeSelector(cls)} { background-repeat: repeat; }`;
3007
+ if (cls === "bg-no-repeat") return `.${escapeSelector(cls)} { background-repeat: no-repeat; }`;
3008
+ if (cls === "bg-repeat-x") return `.${escapeSelector(cls)} { background-repeat: repeat-x; }`;
3009
+ if (cls === "bg-repeat-y") return `.${escapeSelector(cls)} { background-repeat: repeat-y; }`;
3010
+ if (cls === "bg-repeat-round") return `.${escapeSelector(cls)} { background-repeat: round; }`;
3011
+ if (cls === "bg-repeat-space") return `.${escapeSelector(cls)} { background-repeat: space; }`;
3012
+ if (cls === "bg-fixed") return `.${escapeSelector(cls)} { background-attachment: fixed; }`;
3013
+ if (cls === "bg-local") return `.${escapeSelector(cls)} { background-attachment: local; }`;
3014
+ if (cls === "bg-scroll") return `.${escapeSelector(cls)} { background-attachment: scroll; }`;
3015
+ if (cls === "bg-origin-border") return `.${escapeSelector(cls)} { background-origin: border-box; }`;
3016
+ if (cls === "bg-origin-padding") return `.${escapeSelector(cls)} { background-origin: padding-box; }`;
3017
+ if (cls === "bg-origin-content") return `.${escapeSelector(cls)} { background-origin: content-box; }`;
3018
+ if (cls === "bg-clip-border") return `.${escapeSelector(cls)} { background-clip: border-box; }`;
3019
+ if (cls === "bg-clip-padding") return `.${escapeSelector(cls)} { background-clip: padding-box; }`;
3020
+ if (cls === "bg-clip-content") return `.${escapeSelector(cls)} { background-clip: content-box; }`;
3021
+ if (cls === "bg-clip-text") return `.${escapeSelector(cls)} { background-clip: text; -webkit-background-clip: text; }`;
2981
3022
  return null;
2982
3023
  }
2983
3024
  var init_layout = __esm({
2984
3025
  "src/generator/layout.ts"() {
2985
3026
  "use strict";
3027
+ init_utils();
2986
3028
  }
2987
3029
  });
2988
3030
 
@@ -3031,25 +3073,25 @@ function matchSizing(cls, spacing) {
3031
3073
  const wMatch = cls.match(/^w-(.+)$/);
3032
3074
  if (wMatch) {
3033
3075
  const key = wMatch[1];
3034
- if (key === "auto") return `.${cls} { width: auto; }`;
3035
- if (key === "full") return `.${cls} { width: 100%; }`;
3036
- if (key === "screen") return `.${cls} { width: 100vw; }`;
3037
- if (key === "svw") return `.${cls} { width: 100svw; }`;
3038
- if (key === "min") return `.${cls} { width: min-content; }`;
3039
- if (key === "max") return `.${cls} { width: max-content; }`;
3040
- if (key === "fit") return `.${cls} { width: fit-content; }`;
3041
- if (has2(fractions, key)) return `.${cls} { width: ${fractions[key]}; }`;
3042
- if (has2(spacing, key)) return `.${cls} { width: ${spacing[key]}; }`;
3076
+ if (key === "auto") return `.${escapeSelector(cls)} { width: auto; }`;
3077
+ if (key === "full") return `.${escapeSelector(cls)} { width: 100%; }`;
3078
+ if (key === "screen") return `.${escapeSelector(cls)} { width: 100vw; }`;
3079
+ if (key === "svw") return `.${escapeSelector(cls)} { width: 100svw; }`;
3080
+ if (key === "min") return `.${escapeSelector(cls)} { width: min-content; }`;
3081
+ if (key === "max") return `.${escapeSelector(cls)} { width: max-content; }`;
3082
+ if (key === "fit") return `.${escapeSelector(cls)} { width: fit-content; }`;
3083
+ if (has2(fractions, key)) return `.${escapeSelector(cls)} { width: ${fractions[key]}; }`;
3084
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { width: ${spacing[key]}; }`;
3043
3085
  }
3044
3086
  const minWMatch = cls.match(/^min-w-(.+)$/);
3045
3087
  if (minWMatch) {
3046
3088
  const key = minWMatch[1];
3047
- if (key === "0") return `.${cls} { min-width: 0px; }`;
3048
- if (key === "full") return `.${cls} { min-width: 100%; }`;
3049
- if (key === "min") return `.${cls} { min-width: min-content; }`;
3050
- if (key === "max") return `.${cls} { min-width: max-content; }`;
3051
- if (key === "fit") return `.${cls} { min-width: fit-content; }`;
3052
- if (has2(spacing, key)) return `.${cls} { min-width: ${spacing[key]}; }`;
3089
+ if (key === "0") return `.${escapeSelector(cls)} { min-width: 0px; }`;
3090
+ if (key === "full") return `.${escapeSelector(cls)} { min-width: 100%; }`;
3091
+ if (key === "min") return `.${escapeSelector(cls)} { min-width: min-content; }`;
3092
+ if (key === "max") return `.${escapeSelector(cls)} { min-width: max-content; }`;
3093
+ if (key === "fit") return `.${escapeSelector(cls)} { min-width: fit-content; }`;
3094
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { min-width: ${spacing[key]}; }`;
3053
3095
  }
3054
3096
  const maxWMap = {
3055
3097
  none: "none",
@@ -3077,49 +3119,59 @@ function matchSizing(cls, spacing) {
3077
3119
  };
3078
3120
  const maxWMatch = cls.match(/^max-w-(.+)$/);
3079
3121
  if (maxWMatch && has2(maxWMap, maxWMatch[1])) {
3080
- return `.${cls} { max-width: ${maxWMap[maxWMatch[1]]}; }`;
3122
+ return `.${escapeSelector(cls)} { max-width: ${maxWMap[maxWMatch[1]]}; }`;
3081
3123
  }
3082
3124
  const hMatch = cls.match(/^h-(.+)$/);
3083
3125
  if (hMatch) {
3084
3126
  const key = hMatch[1];
3085
- if (key === "auto") return `.${cls} { height: auto; }`;
3086
- if (key === "full") return `.${cls} { height: 100%; }`;
3087
- if (key === "screen") return `.${cls} { height: 100vh; }`;
3088
- if (key === "svh") return `.${cls} { height: 100svh; }`;
3089
- if (key === "dvh") return `.${cls} { height: 100dvh; }`;
3090
- if (key === "min") return `.${cls} { height: min-content; }`;
3091
- if (key === "max") return `.${cls} { height: max-content; }`;
3092
- if (key === "fit") return `.${cls} { height: fit-content; }`;
3093
- if (has2(fractions, key)) return `.${cls} { height: ${fractions[key]}; }`;
3094
- if (has2(spacing, key)) return `.${cls} { height: ${spacing[key]}; }`;
3127
+ if (key === "auto") return `.${escapeSelector(cls)} { height: auto; }`;
3128
+ if (key === "full") return `.${escapeSelector(cls)} { height: 100%; }`;
3129
+ if (key === "screen") return `.${escapeSelector(cls)} { height: 100vh; }`;
3130
+ if (key === "svh") return `.${escapeSelector(cls)} { height: 100svh; }`;
3131
+ if (key === "dvh") return `.${escapeSelector(cls)} { height: 100dvh; }`;
3132
+ if (key === "min") return `.${escapeSelector(cls)} { height: min-content; }`;
3133
+ if (key === "max") return `.${escapeSelector(cls)} { height: max-content; }`;
3134
+ if (key === "fit") return `.${escapeSelector(cls)} { height: fit-content; }`;
3135
+ if (has2(fractions, key)) return `.${escapeSelector(cls)} { height: ${fractions[key]}; }`;
3136
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { height: ${spacing[key]}; }`;
3095
3137
  }
3096
3138
  const minHMatch = cls.match(/^min-h-(.+)$/);
3097
3139
  if (minHMatch) {
3098
3140
  const key = minHMatch[1];
3099
- if (key === "0") return `.${cls} { min-height: 0px; }`;
3100
- if (key === "full") return `.${cls} { min-height: 100%; }`;
3101
- if (key === "screen") return `.${cls} { min-height: 100vh; }`;
3102
- if (key === "svh") return `.${cls} { min-height: 100svh; }`;
3103
- if (key === "dvh") return `.${cls} { min-height: 100dvh; }`;
3104
- if (key === "fit") return `.${cls} { min-height: fit-content; }`;
3105
- if (has2(spacing, key)) return `.${cls} { min-height: ${spacing[key]}; }`;
3141
+ if (key === "0") return `.${escapeSelector(cls)} { min-height: 0px; }`;
3142
+ if (key === "full") return `.${escapeSelector(cls)} { min-height: 100%; }`;
3143
+ if (key === "screen") return `.${escapeSelector(cls)} { min-height: 100vh; }`;
3144
+ if (key === "svh") return `.${escapeSelector(cls)} { min-height: 100svh; }`;
3145
+ if (key === "dvh") return `.${escapeSelector(cls)} { min-height: 100dvh; }`;
3146
+ if (key === "fit") return `.${escapeSelector(cls)} { min-height: fit-content; }`;
3147
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { min-height: ${spacing[key]}; }`;
3106
3148
  }
3107
3149
  const maxHMatch = cls.match(/^max-h-(.+)$/);
3108
3150
  if (maxHMatch) {
3109
3151
  const key = maxHMatch[1];
3110
- if (key === "none") return `.${cls} { max-height: none; }`;
3111
- if (key === "full") return `.${cls} { max-height: 100%; }`;
3112
- if (key === "screen") return `.${cls} { max-height: 100vh; }`;
3113
- if (key === "svh") return `.${cls} { max-height: 100svh; }`;
3114
- if (key === "dvh") return `.${cls} { max-height: 100dvh; }`;
3115
- if (key === "fit") return `.${cls} { max-height: fit-content; }`;
3116
- if (has2(spacing, key)) return `.${cls} { max-height: ${spacing[key]}; }`;
3152
+ if (key === "none") return `.${escapeSelector(cls)} { max-height: none; }`;
3153
+ if (key === "full") return `.${escapeSelector(cls)} { max-height: 100%; }`;
3154
+ if (key === "screen") return `.${escapeSelector(cls)} { max-height: 100vh; }`;
3155
+ if (key === "svh") return `.${escapeSelector(cls)} { max-height: 100svh; }`;
3156
+ if (key === "dvh") return `.${escapeSelector(cls)} { max-height: 100dvh; }`;
3157
+ if (key === "fit") return `.${escapeSelector(cls)} { max-height: fit-content; }`;
3158
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { max-height: ${spacing[key]}; }`;
3159
+ }
3160
+ const basisMatch = cls.match(/^basis-(.+)$/);
3161
+ if (basisMatch) {
3162
+ const key = basisMatch[1];
3163
+ if (key === "auto") return `.${escapeSelector(cls)} { flex-basis: auto; }`;
3164
+ if (key === "full") return `.${escapeSelector(cls)} { flex-basis: 100%; }`;
3165
+ if (key === "0") return `.${escapeSelector(cls)} { flex-basis: 0px; }`;
3166
+ if (has2(fractions, key)) return `.${escapeSelector(cls)} { flex-basis: ${fractions[key]}; }`;
3167
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { flex-basis: ${spacing[key]}; }`;
3117
3168
  }
3118
3169
  return null;
3119
3170
  }
3120
3171
  var init_sizing = __esm({
3121
3172
  "src/generator/sizing.ts"() {
3122
3173
  "use strict";
3174
+ init_utils();
3123
3175
  }
3124
3176
  });
3125
3177
 
@@ -3139,7 +3191,7 @@ function generateEffects(classes, config) {
3139
3191
  function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3140
3192
  const opacityMatch = cls.match(/^opacity-(.+)$/);
3141
3193
  if (opacityMatch && has3(opacity, opacityMatch[1])) {
3142
- return `.${cls} {
3194
+ return `.${escapeSelector(cls)} {
3143
3195
  opacity: ${opacity[opacityMatch[1]]};
3144
3196
  transition-property: opacity;
3145
3197
  transition-duration: var(--alive-duration, 0ms);
@@ -3148,86 +3200,86 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3148
3200
  }
3149
3201
  const zMatch = cls.match(/^z-(.+)$/);
3150
3202
  if (zMatch && has3(zIndex, zMatch[1])) {
3151
- return `.${cls} { z-index: ${zIndex[zMatch[1]]}; }`;
3203
+ return `.${escapeSelector(cls)} { z-index: ${zIndex[zMatch[1]]}; }`;
3152
3204
  }
3153
3205
  const shadowMatch = cls.match(/^shadow(?:-(.+))?$/);
3154
3206
  if (shadowMatch) {
3155
3207
  const key = shadowMatch[1] ?? "DEFAULT";
3156
3208
  if (has3(boxShadow, key)) {
3157
- return `.${cls} { box-shadow: ${boxShadow[key]}; }`;
3209
+ return `.${escapeSelector(cls)} { box-shadow: ${boxShadow[key]}; }`;
3158
3210
  }
3159
3211
  if (!shadowMatch[1] && has3(boxShadow, "DEFAULT")) {
3160
- return `.${cls} { box-shadow: ${boxShadow["DEFAULT"]}; }`;
3212
+ return `.${escapeSelector(cls)} { box-shadow: ${boxShadow["DEFAULT"]}; }`;
3161
3213
  }
3162
3214
  }
3163
3215
  const roundedMatch = cls.match(/^rounded(?:-(.+))?$/);
3164
3216
  if (roundedMatch) {
3165
3217
  const key = roundedMatch[1] ?? "DEFAULT";
3166
- if (has3(borderRadius, key)) return `.${cls} { border-radius: ${borderRadius[key]}; }`;
3167
- if (!roundedMatch[1] && has3(borderRadius, "DEFAULT")) return `.${cls} { border-radius: ${borderRadius["DEFAULT"]}; }`;
3218
+ if (has3(borderRadius, key)) return `.${escapeSelector(cls)} { border-radius: ${borderRadius[key]}; }`;
3219
+ if (!roundedMatch[1] && has3(borderRadius, "DEFAULT")) return `.${escapeSelector(cls)} { border-radius: ${borderRadius["DEFAULT"]}; }`;
3168
3220
  }
3169
3221
  const roundedTMatch = cls.match(/^rounded-t(?:-(.+))?$/);
3170
3222
  if (roundedTMatch) {
3171
3223
  const rkey = roundedTMatch[1] ?? "DEFAULT";
3172
3224
  const val = has3(borderRadius, rkey) ? borderRadius[rkey] : has3(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3173
- if (val) return `.${cls} { border-top-left-radius: ${val}; border-top-right-radius: ${val}; }`;
3225
+ if (val) return `.${escapeSelector(cls)} { border-top-left-radius: ${val}; border-top-right-radius: ${val}; }`;
3174
3226
  }
3175
3227
  const roundedBMatch = cls.match(/^rounded-b(?:-(.+))?$/);
3176
3228
  if (roundedBMatch) {
3177
3229
  const rkey = roundedBMatch[1] ?? "DEFAULT";
3178
3230
  const val = has3(borderRadius, rkey) ? borderRadius[rkey] : has3(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3179
- if (val) return `.${cls} { border-bottom-left-radius: ${val}; border-bottom-right-radius: ${val}; }`;
3231
+ if (val) return `.${escapeSelector(cls)} { border-bottom-left-radius: ${val}; border-bottom-right-radius: ${val}; }`;
3180
3232
  }
3181
3233
  const roundedLMatch = cls.match(/^rounded-l(?:-(.+))?$/);
3182
3234
  if (roundedLMatch) {
3183
3235
  const rkey = roundedLMatch[1] ?? "DEFAULT";
3184
3236
  const val = has3(borderRadius, rkey) ? borderRadius[rkey] : has3(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3185
- if (val) return `.${cls} { border-top-left-radius: ${val}; border-bottom-left-radius: ${val}; }`;
3237
+ if (val) return `.${escapeSelector(cls)} { border-top-left-radius: ${val}; border-bottom-left-radius: ${val}; }`;
3186
3238
  }
3187
3239
  const roundedRMatch = cls.match(/^rounded-r(?:-(.+))?$/);
3188
3240
  if (roundedRMatch) {
3189
3241
  const rkey = roundedRMatch[1] ?? "DEFAULT";
3190
3242
  const val = has3(borderRadius, rkey) ? borderRadius[rkey] : has3(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3191
- if (val) return `.${cls} { border-top-right-radius: ${val}; border-bottom-right-radius: ${val}; }`;
3192
- }
3193
- if (cls === "border") return `.${cls} { border-width: 1px; border-style: solid; }`;
3194
- if (cls === "border-0") return `.${cls} { border-width: 0px; }`;
3195
- if (cls === "border-2") return `.${cls} { border-width: 2px; border-style: solid; }`;
3196
- if (cls === "border-4") return `.${cls} { border-width: 4px; border-style: solid; }`;
3197
- if (cls === "border-8") return `.${cls} { border-width: 8px; border-style: solid; }`;
3198
- if (cls === "border-t") return `.${cls} { border-top-width: 1px; border-top-style: solid; }`;
3199
- if (cls === "border-r") return `.${cls} { border-right-width: 1px; border-right-style: solid; }`;
3200
- if (cls === "border-b") return `.${cls} { border-bottom-width: 1px; border-bottom-style: solid; }`;
3201
- if (cls === "border-l") return `.${cls} { border-left-width: 1px; border-left-style: solid; }`;
3202
- if (cls === "border-t-0") return `.${cls} { border-top-width: 0px; }`;
3203
- if (cls === "border-r-0") return `.${cls} { border-right-width: 0px; }`;
3204
- if (cls === "border-b-0") return `.${cls} { border-bottom-width: 0px; }`;
3205
- if (cls === "border-l-0") return `.${cls} { border-left-width: 0px; }`;
3206
- if (cls === "border-solid") return `.${cls} { border-style: solid; }`;
3207
- if (cls === "border-dashed") return `.${cls} { border-style: dashed; }`;
3208
- if (cls === "border-dotted") return `.${cls} { border-style: dotted; }`;
3209
- if (cls === "border-double") return `.${cls} { border-style: double; }`;
3210
- if (cls === "border-hidden") return `.${cls} { border-style: hidden; }`;
3211
- if (cls === "border-none") return `.${cls} { border-style: none; }`;
3212
- if (cls === "outline-none") return `.${cls} { outline: 2px solid transparent; outline-offset: 2px; }`;
3213
- if (cls === "outline") return `.${cls} { outline-style: solid; }`;
3214
- if (cls === "outline-dashed") return `.${cls} { outline-style: dashed; }`;
3215
- if (cls === "outline-dotted") return `.${cls} { outline-style: dotted; }`;
3216
- if (cls === "outline-double") return `.${cls} { outline-style: double; }`;
3243
+ if (val) return `.${escapeSelector(cls)} { border-top-right-radius: ${val}; border-bottom-right-radius: ${val}; }`;
3244
+ }
3245
+ if (cls === "border") return `.${escapeSelector(cls)} { border-width: 1px; border-style: solid; }`;
3246
+ if (cls === "border-0") return `.${escapeSelector(cls)} { border-width: 0px; }`;
3247
+ if (cls === "border-2") return `.${escapeSelector(cls)} { border-width: 2px; border-style: solid; }`;
3248
+ if (cls === "border-4") return `.${escapeSelector(cls)} { border-width: 4px; border-style: solid; }`;
3249
+ if (cls === "border-8") return `.${escapeSelector(cls)} { border-width: 8px; border-style: solid; }`;
3250
+ if (cls === "border-t") return `.${escapeSelector(cls)} { border-top-width: 1px; border-top-style: solid; }`;
3251
+ if (cls === "border-r") return `.${escapeSelector(cls)} { border-right-width: 1px; border-right-style: solid; }`;
3252
+ if (cls === "border-b") return `.${escapeSelector(cls)} { border-bottom-width: 1px; border-bottom-style: solid; }`;
3253
+ if (cls === "border-l") return `.${escapeSelector(cls)} { border-left-width: 1px; border-left-style: solid; }`;
3254
+ if (cls === "border-t-0") return `.${escapeSelector(cls)} { border-top-width: 0px; }`;
3255
+ if (cls === "border-r-0") return `.${escapeSelector(cls)} { border-right-width: 0px; }`;
3256
+ if (cls === "border-b-0") return `.${escapeSelector(cls)} { border-bottom-width: 0px; }`;
3257
+ if (cls === "border-l-0") return `.${escapeSelector(cls)} { border-left-width: 0px; }`;
3258
+ if (cls === "border-solid") return `.${escapeSelector(cls)} { border-style: solid; }`;
3259
+ if (cls === "border-dashed") return `.${escapeSelector(cls)} { border-style: dashed; }`;
3260
+ if (cls === "border-dotted") return `.${escapeSelector(cls)} { border-style: dotted; }`;
3261
+ if (cls === "border-double") return `.${escapeSelector(cls)} { border-style: double; }`;
3262
+ if (cls === "border-hidden") return `.${escapeSelector(cls)} { border-style: hidden; }`;
3263
+ if (cls === "border-none") return `.${escapeSelector(cls)} { border-style: none; }`;
3264
+ if (cls === "outline-none") return `.${escapeSelector(cls)} { outline: 2px solid transparent; outline-offset: 2px; }`;
3265
+ if (cls === "outline") return `.${escapeSelector(cls)} { outline-style: solid; }`;
3266
+ if (cls === "outline-dashed") return `.${escapeSelector(cls)} { outline-style: dashed; }`;
3267
+ if (cls === "outline-dotted") return `.${escapeSelector(cls)} { outline-style: dotted; }`;
3268
+ if (cls === "outline-double") return `.${escapeSelector(cls)} { outline-style: double; }`;
3217
3269
  const outlineWidthMatch = cls.match(/^outline-(\d+)$/);
3218
- if (outlineWidthMatch) return `.${cls} { outline-width: ${outlineWidthMatch[1]}px; }`;
3270
+ if (outlineWidthMatch) return `.${escapeSelector(cls)} { outline-width: ${outlineWidthMatch[1]}px; }`;
3219
3271
  const outlineOffsetMatch = cls.match(/^outline-offset-(\d+)$/);
3220
- if (outlineOffsetMatch) return `.${cls} { outline-offset: ${outlineOffsetMatch[1]}px; }`;
3272
+ if (outlineOffsetMatch) return `.${escapeSelector(cls)} { outline-offset: ${outlineOffsetMatch[1]}px; }`;
3221
3273
  const ringMatch = cls.match(/^ring(?:-(\d+))?$/);
3222
3274
  if (ringMatch) {
3223
3275
  const width = ringMatch[1] ?? "3";
3224
- return `.${cls} { box-shadow: 0 0 0 ${width}px var(--alive-ring-color, rgba(59, 130, 246, 0.5)); }`;
3276
+ return `.${escapeSelector(cls)} { box-shadow: 0 0 0 ${width}px var(--alive-ring-color, rgba(59, 130, 246, 0.5)); }`;
3225
3277
  }
3226
- if (cls === "ring-inset") return `.${cls} { --alive-ring-inset: inset; }`;
3278
+ if (cls === "ring-inset") return `.${escapeSelector(cls)} { --alive-ring-inset: inset; }`;
3227
3279
  const ringOffsetMatch = cls.match(/^ring-offset-(\d+)$/);
3228
- if (ringOffsetMatch) return `.${cls} { --alive-ring-offset: ${ringOffsetMatch[1]}px; }`;
3229
- 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)); }`;
3230
- if (cls === "transform-none") return `.${cls} { transform: none; }`;
3280
+ if (ringOffsetMatch) return `.${escapeSelector(cls)} { --alive-ring-offset: ${ringOffsetMatch[1]}px; }`;
3281
+ 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)); }`;
3282
+ if (cls === "transform-none") return `.${escapeSelector(cls)} { transform: none; }`;
3231
3283
  const scaleMap = {
3232
3284
  "0": "0",
3233
3285
  "50": ".5",
@@ -3242,15 +3294,15 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3242
3294
  };
3243
3295
  const scaleMatch = cls.match(/^scale-(\d+)$/);
3244
3296
  if (scaleMatch && has3(scaleMap, scaleMatch[1])) {
3245
- return `.${cls} { transform: scale(${scaleMap[scaleMatch[1]]}); }`;
3297
+ return `.${escapeSelector(cls)} { transform: scale(${scaleMap[scaleMatch[1]]}); }`;
3246
3298
  }
3247
3299
  const scaleXMatch = cls.match(/^scale-x-(\d+)$/);
3248
3300
  if (scaleXMatch && has3(scaleMap, scaleXMatch[1])) {
3249
- return `.${cls} { transform: scaleX(${scaleMap[scaleXMatch[1]]}); }`;
3301
+ return `.${escapeSelector(cls)} { transform: scaleX(${scaleMap[scaleXMatch[1]]}); }`;
3250
3302
  }
3251
3303
  const scaleYMatch = cls.match(/^scale-y-(\d+)$/);
3252
3304
  if (scaleYMatch && has3(scaleMap, scaleYMatch[1])) {
3253
- return `.${cls} { transform: scaleY(${scaleMap[scaleYMatch[1]]}); }`;
3305
+ return `.${escapeSelector(cls)} { transform: scaleY(${scaleMap[scaleYMatch[1]]}); }`;
3254
3306
  }
3255
3307
  const rotateMatch = cls.match(/^-?rotate-(\d+)$/);
3256
3308
  if (rotateMatch) {
@@ -3273,12 +3325,12 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3273
3325
  const val = fractions[key] ?? null;
3274
3326
  if (val) return `.${cls.replace(/^-/, "\\-")} { transform: translateY(${neg}${val}); }`;
3275
3327
  }
3276
- if (cls === "transition-none") return `.${cls} { transition: none; }`;
3277
- if (cls === "transition-all") return `.${cls} { transition: all var(--alive-duration-normal) var(--alive-ease-standard); }`;
3278
- 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); }`;
3279
- if (cls === "transition-opacity") return `.${cls} { transition: opacity; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3280
- if (cls === "transition-shadow") return `.${cls} { transition: box-shadow; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3281
- if (cls === "transition-transform") return `.${cls} { transition: transform; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3328
+ if (cls === "transition-none") return `.${escapeSelector(cls)} { transition: none; }`;
3329
+ if (cls === "transition-all") return `.${escapeSelector(cls)} { transition: all var(--alive-duration-normal) var(--alive-ease-standard); }`;
3330
+ 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); }`;
3331
+ if (cls === "transition-opacity") return `.${escapeSelector(cls)} { transition: opacity; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3332
+ if (cls === "transition-shadow") return `.${escapeSelector(cls)} { transition: box-shadow; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3333
+ if (cls === "transition-transform") return `.${escapeSelector(cls)} { transition: transform; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3282
3334
  const blurMatch = cls.match(/^blur(?:-(.+))?$/);
3283
3335
  if (blurMatch) {
3284
3336
  const blurMap = {
@@ -3292,7 +3344,7 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3292
3344
  "3xl": "64px"
3293
3345
  };
3294
3346
  const key = blurMatch[1] ?? "DEFAULT";
3295
- if (has3(blurMap, key)) return `.${cls} { filter: blur(${blurMap[key]}); }`;
3347
+ if (has3(blurMap, key)) return `.${escapeSelector(cls)} { filter: blur(${blurMap[key]}); }`;
3296
3348
  }
3297
3349
  const backdropBlurMatch = cls.match(/^backdrop-blur(?:-(.+))?$/);
3298
3350
  if (backdropBlurMatch) {
@@ -3307,7 +3359,7 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3307
3359
  "3xl": "64px"
3308
3360
  };
3309
3361
  const key = backdropBlurMatch[1] ?? "DEFAULT";
3310
- if (has3(blurMap, key)) return `.${cls} { backdrop-filter: blur(${blurMap[key]}); }`;
3362
+ if (has3(blurMap, key)) return `.${escapeSelector(cls)} { backdrop-filter: blur(${blurMap[key]}); }`;
3311
3363
  }
3312
3364
  const arbOpacityMatch = cls.match(/^opacity-\[(.+)\]$/);
3313
3365
  if (arbOpacityMatch) {
@@ -3442,6 +3494,9 @@ function generateUtilities(classes, config) {
3442
3494
  case "placeholder":
3443
3495
  selector += "::placeholder";
3444
3496
  break;
3497
+ case "file":
3498
+ selector += "::file-selector-button";
3499
+ break;
3445
3500
  case "group-hover":
3446
3501
  selector = `.group:hover ${selector}`;
3447
3502
  break;
@@ -3536,275 +3591,275 @@ function generateAliveSpecific(classes, _config) {
3536
3591
  ];
3537
3592
  if (aliveBasePrefixes.some((p) => cls === p || cls.startsWith(p + "-"))) continue;
3538
3593
  if (cls === "animate-none") {
3539
- rules.push(`.${cls} { animation: none; }`);
3594
+ rules.push(`.${escapeSelector(cls)} { animation: none; }`);
3540
3595
  continue;
3541
3596
  }
3542
3597
  if (cls === "animate-spin") {
3543
- rules.push(`.${cls} { animation: alive-spin 1s linear infinite; }`);
3598
+ rules.push(`.${escapeSelector(cls)} { animation: alive-spin 1s linear infinite; }`);
3544
3599
  continue;
3545
3600
  }
3546
3601
  if (cls === "animate-ping") {
3547
- rules.push(`.${cls} { animation: alive-ping 1s cubic-bezier(0,0,0.2,1) infinite; }`);
3602
+ rules.push(`.${escapeSelector(cls)} { animation: alive-ping 1s cubic-bezier(0,0,0.2,1) infinite; }`);
3548
3603
  continue;
3549
3604
  }
3550
3605
  if (cls === "animate-pulse") {
3551
- rules.push(`.${cls} { animation: alive-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }`);
3606
+ rules.push(`.${escapeSelector(cls)} { animation: alive-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }`);
3552
3607
  continue;
3553
3608
  }
3554
3609
  if (cls === "animate-bounce") {
3555
- rules.push(`.${cls} { animation: alive-bounce 1s infinite; }`);
3610
+ rules.push(`.${escapeSelector(cls)} { animation: alive-bounce 1s infinite; }`);
3556
3611
  continue;
3557
3612
  }
3558
3613
  if (cls === "animate-shimmer") {
3559
- rules.push(`.${cls} { animation: alive-shimmer 1.5s linear infinite; }`);
3614
+ rules.push(`.${escapeSelector(cls)} { animation: alive-shimmer 1.5s linear infinite; }`);
3560
3615
  continue;
3561
3616
  }
3562
3617
  if (cls === "ease-linear") {
3563
- rules.push(`.${cls} { transition-timing-function: linear; }`);
3618
+ rules.push(`.${escapeSelector(cls)} { transition-timing-function: linear; }`);
3564
3619
  continue;
3565
3620
  }
3566
3621
  if (cls === "ease-in") {
3567
- rules.push(`.${cls} { transition-timing-function: cubic-bezier(0.4,0,1,1); }`);
3622
+ rules.push(`.${escapeSelector(cls)} { transition-timing-function: cubic-bezier(0.4,0,1,1); }`);
3568
3623
  continue;
3569
3624
  }
3570
3625
  if (cls === "ease-out") {
3571
- rules.push(`.${cls} { transition-timing-function: cubic-bezier(0,0,0.2,1); }`);
3626
+ rules.push(`.${escapeSelector(cls)} { transition-timing-function: cubic-bezier(0,0,0.2,1); }`);
3572
3627
  continue;
3573
3628
  }
3574
3629
  if (cls === "ease-in-out") {
3575
- rules.push(`.${cls} { transition-timing-function: cubic-bezier(0.4,0,0.2,1); }`);
3630
+ rules.push(`.${escapeSelector(cls)} { transition-timing-function: cubic-bezier(0.4,0,0.2,1); }`);
3576
3631
  continue;
3577
3632
  }
3578
3633
  if (cls === "group") {
3579
- rules.push(`.${cls} {}`);
3634
+ rules.push(`.${escapeSelector(cls)} {}`);
3580
3635
  continue;
3581
3636
  }
3582
3637
  const staggerMatch = cls.match(/^stagger-(\d+)$/);
3583
3638
  if (staggerMatch) {
3584
- rules.push(`.${cls} { --alive-stagger-gap: ${staggerMatch[1]}ms; }`);
3639
+ rules.push(`.${escapeSelector(cls)} { --alive-stagger-gap: ${staggerMatch[1]}ms; }`);
3585
3640
  continue;
3586
3641
  }
3587
3642
  const indexMatch = cls.match(/^alive-index-(\d+)$/);
3588
3643
  if (indexMatch) {
3589
- rules.push(`.${cls} { --alive-index: ${indexMatch[1]}; }`);
3644
+ rules.push(`.${escapeSelector(cls)} { --alive-index: ${indexMatch[1]}; }`);
3590
3645
  continue;
3591
3646
  }
3592
3647
  const durationMatch = cls.match(/^duration-(\d+)$/);
3593
3648
  if (durationMatch) {
3594
- rules.push(`.${cls} { --alive-duration: ${durationMatch[1]}ms; }`);
3649
+ rules.push(`.${escapeSelector(cls)} { --alive-duration: ${durationMatch[1]}ms; }`);
3595
3650
  continue;
3596
3651
  }
3597
3652
  const delayMatch = cls.match(/^delay-(\d+)$/);
3598
3653
  if (delayMatch) {
3599
- rules.push(`.${cls} { animation-delay: ${delayMatch[1]}ms; }`);
3654
+ rules.push(`.${escapeSelector(cls)} { animation-delay: ${delayMatch[1]}ms; }`);
3600
3655
  continue;
3601
3656
  }
3602
3657
  const motionMsMatch = cls.match(/^motion-(\d+)$/);
3603
3658
  if (motionMsMatch) {
3604
- rules.push(`.${cls} { --alive-duration: ${motionMsMatch[1]}ms !important; }`);
3659
+ rules.push(`.${escapeSelector(cls)} { --alive-duration: ${motionMsMatch[1]}ms !important; }`);
3605
3660
  continue;
3606
3661
  }
3607
3662
  if (cls === "divide-x") {
3608
- rules.push(`.${cls} > * + * { border-left-width: 1px; border-left-style: solid; }`);
3663
+ rules.push(`.${escapeSelector(cls)}> * + * { border-left-width: 1px; border-left-style: solid; }`);
3609
3664
  continue;
3610
3665
  }
3611
3666
  if (cls === "divide-y") {
3612
- rules.push(`.${cls} > * + * { border-top-width: 1px; border-top-style: solid; }`);
3667
+ rules.push(`.${escapeSelector(cls)}> * + * { border-top-width: 1px; border-top-style: solid; }`);
3613
3668
  continue;
3614
3669
  }
3615
3670
  const divideColorMatch = cls.match(/^divide-([a-z]+)(?:-(\d+))?$/);
3616
3671
  if (divideColorMatch) {
3617
- rules.push(`.${cls} > * + * { border-color: inherit; }`);
3672
+ rules.push(`.${escapeSelector(cls)}> * + * { border-color: inherit; }`);
3618
3673
  continue;
3619
3674
  }
3620
3675
  if (cls === "appearance-none") {
3621
- rules.push(`.${cls} { appearance: none; }`);
3676
+ rules.push(`.${escapeSelector(cls)} { appearance: none; }`);
3622
3677
  continue;
3623
3678
  }
3624
3679
  if (cls === "appearance-auto") {
3625
- rules.push(`.${cls} { appearance: auto; }`);
3680
+ rules.push(`.${escapeSelector(cls)} { appearance: auto; }`);
3626
3681
  continue;
3627
3682
  }
3628
3683
  if (cls === "resize-none") {
3629
- rules.push(`.${cls} { resize: none; }`);
3684
+ rules.push(`.${escapeSelector(cls)} { resize: none; }`);
3630
3685
  continue;
3631
3686
  }
3632
3687
  if (cls === "resize") {
3633
- rules.push(`.${cls} { resize: both; }`);
3688
+ rules.push(`.${escapeSelector(cls)} { resize: both; }`);
3634
3689
  continue;
3635
3690
  }
3636
3691
  if (cls === "resize-y") {
3637
- rules.push(`.${cls} { resize: vertical; }`);
3692
+ rules.push(`.${escapeSelector(cls)} { resize: vertical; }`);
3638
3693
  continue;
3639
3694
  }
3640
3695
  if (cls === "resize-x") {
3641
- rules.push(`.${cls} { resize: horizontal; }`);
3696
+ rules.push(`.${escapeSelector(cls)} { resize: horizontal; }`);
3642
3697
  continue;
3643
3698
  }
3644
3699
  if (cls === "snap-none") {
3645
- rules.push(`.${cls} { scroll-snap-type: none; }`);
3700
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-type: none; }`);
3646
3701
  continue;
3647
3702
  }
3648
3703
  if (cls === "snap-x") {
3649
- rules.push(`.${cls} { scroll-snap-type: x mandatory; }`);
3704
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-type: x mandatory; }`);
3650
3705
  continue;
3651
3706
  }
3652
3707
  if (cls === "snap-y") {
3653
- rules.push(`.${cls} { scroll-snap-type: y mandatory; }`);
3708
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-type: y mandatory; }`);
3654
3709
  continue;
3655
3710
  }
3656
3711
  if (cls === "snap-start") {
3657
- rules.push(`.${cls} { scroll-snap-align: start; }`);
3712
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-align: start; }`);
3658
3713
  continue;
3659
3714
  }
3660
3715
  if (cls === "snap-center") {
3661
- rules.push(`.${cls} { scroll-snap-align: center; }`);
3716
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-align: center; }`);
3662
3717
  continue;
3663
3718
  }
3664
3719
  if (cls === "snap-end") {
3665
- rules.push(`.${cls} { scroll-snap-align: end; }`);
3720
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-align: end; }`);
3666
3721
  continue;
3667
3722
  }
3668
3723
  if (cls === "pointer-events-none") {
3669
- rules.push(`.${cls} { pointer-events: none; }`);
3724
+ rules.push(`.${escapeSelector(cls)} { pointer-events: none; }`);
3670
3725
  continue;
3671
3726
  }
3672
3727
  if (cls === "pointer-events-auto") {
3673
- rules.push(`.${cls} { pointer-events: auto; }`);
3728
+ rules.push(`.${escapeSelector(cls)} { pointer-events: auto; }`);
3674
3729
  continue;
3675
3730
  }
3676
3731
  if (cls === "sr-only") {
3677
- 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; }`);
3732
+ 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; }`);
3678
3733
  continue;
3679
3734
  }
3680
3735
  if (cls === "not-sr-only") {
3681
- rules.push(`.${cls} { position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; white-space: normal; }`);
3736
+ rules.push(`.${escapeSelector(cls)} { position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; white-space: normal; }`);
3682
3737
  continue;
3683
3738
  }
3684
3739
  if (cls === "will-change-auto") {
3685
- rules.push(`.${cls} { will-change: auto; }`);
3740
+ rules.push(`.${escapeSelector(cls)} { will-change: auto; }`);
3686
3741
  continue;
3687
3742
  }
3688
3743
  if (cls === "will-change-transform") {
3689
- rules.push(`.${cls} { will-change: transform; }`);
3744
+ rules.push(`.${escapeSelector(cls)} { will-change: transform; }`);
3690
3745
  continue;
3691
3746
  }
3692
3747
  if (cls === "will-change-opacity") {
3693
- rules.push(`.${cls} { will-change: opacity; }`);
3748
+ rules.push(`.${escapeSelector(cls)} { will-change: opacity; }`);
3694
3749
  continue;
3695
3750
  }
3696
3751
  const lineClampMatch = cls.match(/^line-clamp-(\d+)$/);
3697
3752
  if (lineClampMatch) {
3698
3753
  const n = lineClampMatch[1];
3699
- rules.push(`.${cls} { overflow: hidden; display: -webkit-box; -webkit-line-clamp: ${n}; -webkit-box-orient: vertical; }`);
3754
+ rules.push(`.${escapeSelector(cls)} { overflow: hidden; display: -webkit-box; -webkit-line-clamp: ${n}; -webkit-box-orient: vertical; }`);
3700
3755
  continue;
3701
3756
  }
3702
3757
  if (cls === "aspect-square") {
3703
- rules.push(`.${cls} { aspect-ratio: 1 / 1; }`);
3758
+ rules.push(`.${escapeSelector(cls)} { aspect-ratio: 1 / 1; }`);
3704
3759
  continue;
3705
3760
  }
3706
3761
  if (cls === "aspect-video") {
3707
- rules.push(`.${cls} { aspect-ratio: 16 / 9; }`);
3762
+ rules.push(`.${escapeSelector(cls)} { aspect-ratio: 16 / 9; }`);
3708
3763
  continue;
3709
3764
  }
3710
3765
  if (cls === "aspect-auto") {
3711
- rules.push(`.${cls} { aspect-ratio: auto; }`);
3766
+ rules.push(`.${escapeSelector(cls)} { aspect-ratio: auto; }`);
3712
3767
  continue;
3713
3768
  }
3714
3769
  if (cls === "object-contain") {
3715
- rules.push(`.${cls} { object-fit: contain; }`);
3770
+ rules.push(`.${escapeSelector(cls)} { object-fit: contain; }`);
3716
3771
  continue;
3717
3772
  }
3718
3773
  if (cls === "object-cover") {
3719
- rules.push(`.${cls} { object-fit: cover; }`);
3774
+ rules.push(`.${escapeSelector(cls)} { object-fit: cover; }`);
3720
3775
  continue;
3721
3776
  }
3722
3777
  if (cls === "object-fill") {
3723
- rules.push(`.${cls} { object-fit: fill; }`);
3778
+ rules.push(`.${escapeSelector(cls)} { object-fit: fill; }`);
3724
3779
  continue;
3725
3780
  }
3726
3781
  if (cls === "object-none") {
3727
- rules.push(`.${cls} { object-fit: none; }`);
3782
+ rules.push(`.${escapeSelector(cls)} { object-fit: none; }`);
3728
3783
  continue;
3729
3784
  }
3730
3785
  if (cls === "object-scale") {
3731
- rules.push(`.${cls} { object-fit: scale-down; }`);
3786
+ rules.push(`.${escapeSelector(cls)} { object-fit: scale-down; }`);
3732
3787
  continue;
3733
3788
  }
3734
3789
  if (cls === "mix-blend-multiply") {
3735
- rules.push(`.${cls} { mix-blend-mode: multiply; }`);
3790
+ rules.push(`.${escapeSelector(cls)} { mix-blend-mode: multiply; }`);
3736
3791
  continue;
3737
3792
  }
3738
3793
  if (cls === "mix-blend-screen") {
3739
- rules.push(`.${cls} { mix-blend-mode: screen; }`);
3794
+ rules.push(`.${escapeSelector(cls)} { mix-blend-mode: screen; }`);
3740
3795
  continue;
3741
3796
  }
3742
3797
  if (cls === "mix-blend-overlay") {
3743
- rules.push(`.${cls} { mix-blend-mode: overlay; }`);
3798
+ rules.push(`.${escapeSelector(cls)} { mix-blend-mode: overlay; }`);
3744
3799
  continue;
3745
3800
  }
3746
3801
  if (cls === "mix-blend-normal") {
3747
- rules.push(`.${cls} { mix-blend-mode: normal; }`);
3802
+ rules.push(`.${escapeSelector(cls)} { mix-blend-mode: normal; }`);
3748
3803
  continue;
3749
3804
  }
3750
3805
  if (cls === "isolate") {
3751
- rules.push(`.${cls} { isolation: isolate; }`);
3806
+ rules.push(`.${escapeSelector(cls)} { isolation: isolate; }`);
3752
3807
  continue;
3753
3808
  }
3754
3809
  if (cls === "isolation-auto") {
3755
- rules.push(`.${cls} { isolation: auto; }`);
3810
+ rules.push(`.${escapeSelector(cls)} { isolation: auto; }`);
3756
3811
  continue;
3757
3812
  }
3758
3813
  if (cls === "touch-auto") {
3759
- rules.push(`.${cls} { touch-action: auto; }`);
3814
+ rules.push(`.${escapeSelector(cls)} { touch-action: auto; }`);
3760
3815
  continue;
3761
3816
  }
3762
3817
  if (cls === "touch-none") {
3763
- rules.push(`.${cls} { touch-action: none; }`);
3818
+ rules.push(`.${escapeSelector(cls)} { touch-action: none; }`);
3764
3819
  continue;
3765
3820
  }
3766
3821
  if (cls === "touch-pan-x") {
3767
- rules.push(`.${cls} { touch-action: pan-x; }`);
3822
+ rules.push(`.${escapeSelector(cls)} { touch-action: pan-x; }`);
3768
3823
  continue;
3769
3824
  }
3770
3825
  if (cls === "touch-pan-y") {
3771
- rules.push(`.${cls} { touch-action: pan-y; }`);
3826
+ rules.push(`.${escapeSelector(cls)} { touch-action: pan-y; }`);
3772
3827
  continue;
3773
3828
  }
3774
3829
  if (cls === "touch-manipulation") {
3775
- rules.push(`.${cls} { touch-action: manipulation; }`);
3830
+ rules.push(`.${escapeSelector(cls)} { touch-action: manipulation; }`);
3776
3831
  continue;
3777
3832
  }
3778
3833
  if (cls === "select-none") {
3779
- rules.push(`.${cls} { user-select: none; }`);
3834
+ rules.push(`.${escapeSelector(cls)} { user-select: none; }`);
3780
3835
  continue;
3781
3836
  }
3782
3837
  if (cls === "select-text") {
3783
- rules.push(`.${cls} { user-select: text; }`);
3838
+ rules.push(`.${escapeSelector(cls)} { user-select: text; }`);
3784
3839
  continue;
3785
3840
  }
3786
3841
  if (cls === "select-all") {
3787
- rules.push(`.${cls} { user-select: all; }`);
3842
+ rules.push(`.${escapeSelector(cls)} { user-select: all; }`);
3788
3843
  continue;
3789
3844
  }
3790
3845
  if (cls === "select-auto") {
3791
- rules.push(`.${cls} { user-select: auto; }`);
3846
+ rules.push(`.${escapeSelector(cls)} { user-select: auto; }`);
3792
3847
  continue;
3793
3848
  }
3794
3849
  if (cls === "break-normal") {
3795
- rules.push(`.${cls} { overflow-wrap: normal; word-break: normal; }`);
3850
+ rules.push(`.${escapeSelector(cls)} { overflow-wrap: normal; word-break: normal; }`);
3796
3851
  continue;
3797
3852
  }
3798
3853
  if (cls === "break-words") {
3799
- rules.push(`.${cls} { overflow-wrap: break-word; }`);
3854
+ rules.push(`.${escapeSelector(cls)} { overflow-wrap: break-word; }`);
3800
3855
  continue;
3801
3856
  }
3802
3857
  if (cls === "break-all") {
3803
- rules.push(`.${cls} { word-break: break-all; }`);
3858
+ rules.push(`.${escapeSelector(cls)} { word-break: break-all; }`);
3804
3859
  continue;
3805
3860
  }
3806
3861
  if (cls === "break-keep") {
3807
- rules.push(`.${cls} { word-break: keep-all; }`);
3862
+ rules.push(`.${escapeSelector(cls)} { word-break: keep-all; }`);
3808
3863
  continue;
3809
3864
  }
3810
3865
  }
@@ -3849,14 +3904,23 @@ var init_src = __esm({
3849
3904
  postcssPlugin: "aliveui",
3850
3905
  async Once(root, { result, postcss }) {
3851
3906
  const classes = await scanContent(config);
3907
+ const hasAliveDirective = root.some((node) => node.type === "atrule" && node.name === "aliveui");
3908
+ if (hasAliveDirective) {
3909
+ const layerDecl = postcss.atRule({ name: "layer", params: "aliveui.base, aliveui.utilities" });
3910
+ root.prepend(layerDecl);
3911
+ }
3852
3912
  root.walkAtRules("aliveui", (atRule) => {
3853
3913
  const param = atRule.params.trim();
3854
3914
  if (param === "base") {
3855
- const css = generateBase(config);
3915
+ const css = `@layer aliveui.base {
3916
+ ${generateBase(config)}
3917
+ }`;
3856
3918
  const parsed = postcss.parse(css, { from: atRule.source?.input.file });
3857
3919
  atRule.replaceWith(parsed.nodes);
3858
3920
  } else if (param === "utilities") {
3859
- const css = generateUtilities(classes, config);
3921
+ const css = `@layer aliveui.utilities {
3922
+ ${generateUtilities(classes, config)}
3923
+ }`;
3860
3924
  const parsed = postcss.parse(css, { from: atRule.source?.input.file });
3861
3925
  atRule.replaceWith(parsed.nodes);
3862
3926
  } else {