@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/cli.js CHANGED
@@ -2193,6 +2193,19 @@ function resolveColor(colors, name, shade) {
2193
2193
  if (!Object.prototype.hasOwnProperty.call(entry, shade)) return null;
2194
2194
  return entry[shade] ?? null;
2195
2195
  }
2196
+ function applyOpacity(value, opacity) {
2197
+ const alpha = +(opacity / 100).toFixed(3);
2198
+ const hexMatch = value.match(/^#([0-9a-fA-F]{3,6})$/);
2199
+ if (hexMatch) {
2200
+ let hex = hexMatch[1];
2201
+ if (hex.length === 3) hex = hex.split("").map((c) => c + c).join("");
2202
+ const r = parseInt(hex.slice(0, 2), 16);
2203
+ const g = parseInt(hex.slice(2, 4), 16);
2204
+ const b = parseInt(hex.slice(4, 6), 16);
2205
+ return `rgba(${r}, ${g}, ${b}, ${alpha})`;
2206
+ }
2207
+ return `color-mix(in srgb, ${value} ${opacity}%, transparent)`;
2208
+ }
2196
2209
  function parseVariants(cls) {
2197
2210
  const variants = [];
2198
2211
  let depth = 0;
@@ -2232,7 +2245,7 @@ function matchColor(cls, colors) {
2232
2245
  if (bgMatch) {
2233
2246
  const value = resolveColor(colors, bgMatch[1], bgMatch[2]);
2234
2247
  if (value) {
2235
- return `.${cls} {
2248
+ return `.${escapeSelector(cls)} {
2236
2249
  background-color: ${value};${transitioned("background-color")}
2237
2250
  }`;
2238
2251
  }
@@ -2241,7 +2254,7 @@ function matchColor(cls, colors) {
2241
2254
  if (textColorMatch) {
2242
2255
  const value = resolveColor(colors, textColorMatch[1], textColorMatch[2]);
2243
2256
  if (value) {
2244
- return `.${cls} {
2257
+ return `.${escapeSelector(cls)} {
2245
2258
  color: ${value};${transitioned("color")}
2246
2259
  }`;
2247
2260
  }
@@ -2250,7 +2263,7 @@ function matchColor(cls, colors) {
2250
2263
  if (borderColorMatch) {
2251
2264
  const value = resolveColor(colors, borderColorMatch[1], borderColorMatch[2]);
2252
2265
  if (value) {
2253
- return `.${cls} {
2266
+ return `.${escapeSelector(cls)} {
2254
2267
  border-color: ${value};${transitioned("border-color")}
2255
2268
  }`;
2256
2269
  }
@@ -2259,7 +2272,7 @@ function matchColor(cls, colors) {
2259
2272
  if (ringColorMatch) {
2260
2273
  const value = resolveColor(colors, ringColorMatch[1], ringColorMatch[2]);
2261
2274
  if (value) {
2262
- return `.${cls} {
2275
+ return `.${escapeSelector(cls)} {
2263
2276
  --alive-ring-color: ${value};
2264
2277
  }`;
2265
2278
  }
@@ -2268,7 +2281,7 @@ function matchColor(cls, colors) {
2268
2281
  if (outlineColorMatch) {
2269
2282
  const value = resolveColor(colors, outlineColorMatch[1], outlineColorMatch[2]);
2270
2283
  if (value) {
2271
- return `.${cls} {
2284
+ return `.${escapeSelector(cls)} {
2272
2285
  outline-color: ${value};
2273
2286
  }`;
2274
2287
  }
@@ -2277,7 +2290,7 @@ function matchColor(cls, colors) {
2277
2290
  if (fillMatch) {
2278
2291
  const value = resolveColor(colors, fillMatch[1], fillMatch[2]);
2279
2292
  if (value) {
2280
- return `.${cls} {
2293
+ return `.${escapeSelector(cls)} {
2281
2294
  fill: ${value};
2282
2295
  }`;
2283
2296
  }
@@ -2286,7 +2299,7 @@ function matchColor(cls, colors) {
2286
2299
  if (strokeMatch) {
2287
2300
  const value = resolveColor(colors, strokeMatch[1], strokeMatch[2]);
2288
2301
  if (value) {
2289
- return `.${cls} {
2302
+ return `.${escapeSelector(cls)} {
2290
2303
  stroke: ${value};
2291
2304
  }`;
2292
2305
  }
@@ -2295,7 +2308,7 @@ function matchColor(cls, colors) {
2295
2308
  if (decorationMatch) {
2296
2309
  const value = resolveColor(colors, decorationMatch[1], decorationMatch[2]);
2297
2310
  if (value) {
2298
- return `.${cls} {
2311
+ return `.${escapeSelector(cls)} {
2299
2312
  text-decoration-color: ${value};
2300
2313
  }`;
2301
2314
  }
@@ -2304,7 +2317,7 @@ function matchColor(cls, colors) {
2304
2317
  if (caretMatch) {
2305
2318
  const value = resolveColor(colors, caretMatch[1], caretMatch[2]);
2306
2319
  if (value) {
2307
- return `.${cls} {
2320
+ return `.${escapeSelector(cls)} {
2308
2321
  caret-color: ${value};
2309
2322
  }`;
2310
2323
  }
@@ -2313,7 +2326,7 @@ function matchColor(cls, colors) {
2313
2326
  if (accentMatch) {
2314
2327
  const value = resolveColor(colors, accentMatch[1], accentMatch[2]);
2315
2328
  if (value) {
2316
- return `.${cls} {
2329
+ return `.${escapeSelector(cls)} {
2317
2330
  accent-color: ${value};
2318
2331
  }`;
2319
2332
  }
@@ -2322,49 +2335,72 @@ function matchColor(cls, colors) {
2322
2335
  if (shadowColorMatch) {
2323
2336
  const value = resolveColor(colors, shadowColorMatch[1], shadowColorMatch[2]);
2324
2337
  if (value) {
2325
- return `.${cls} {
2338
+ return `.${escapeSelector(cls)} {
2326
2339
  --alive-shadow-color: ${value};
2327
2340
  }`;
2328
2341
  }
2329
2342
  }
2330
- const arbBgMatch = cls.match(/^bg-\[(.+)\]$/);
2343
+ const arbBgMatch = cls.match(/^bg-\[(.+)\](?:\/(\d+))?$/);
2331
2344
  if (arbBgMatch) {
2332
- const val = arbBgMatch[1];
2345
+ const [, val, opStr] = arbBgMatch;
2333
2346
  const escaped = escapeSelector(cls);
2334
2347
  if (val.startsWith("url(") || val.startsWith("linear-gradient") || val.startsWith("radial-gradient")) {
2335
2348
  return `.${escaped} {
2336
2349
  background-image: ${val};${transitioned("background-image")}
2337
2350
  }`;
2338
2351
  }
2352
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2339
2353
  return `.${escaped} {
2340
- background-color: ${val};${transitioned("background-color")}
2354
+ background-color: ${colorVal};${transitioned("background-color")}
2341
2355
  }`;
2342
2356
  }
2343
- const arbTextMatch = cls.match(/^text-\[(.+)\]$/);
2357
+ const arbTextMatch = cls.match(/^text-\[(.+)\](?:\/(\d+))?$/);
2344
2358
  if (arbTextMatch) {
2359
+ const [, val, opStr] = arbTextMatch;
2360
+ 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);
2361
+ if (isSizeValue) {
2362
+ return `.${escapeSelector(cls)} {
2363
+ font-size: ${val};
2364
+ }`;
2365
+ }
2366
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2345
2367
  return `.${escapeSelector(cls)} {
2346
- color: ${arbTextMatch[1]};${transitioned("color")}
2368
+ color: ${colorVal};${transitioned("color")}
2347
2369
  }`;
2348
2370
  }
2349
- const arbBorderColorMatch = cls.match(/^border-\[#[0-9a-fA-F]|^border-\[rgb|^border-\[hsl|^border-\[oklch/);
2371
+ const arbBorderColorMatch = cls.match(/^border-\[(.+)\](?:\/(\d+))?$/);
2350
2372
  if (arbBorderColorMatch) {
2351
- const m = cls.match(/^border-\[(.+)\]$/);
2352
- if (m) {
2373
+ const [, val, opStr] = arbBorderColorMatch;
2374
+ const looksLikeColor = val.startsWith("#") || val.startsWith("rgb") || val.startsWith("hsl") || val.startsWith("oklch") || val.startsWith("var(") || val === "transparent" || val === "currentColor";
2375
+ if (looksLikeColor) {
2376
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2353
2377
  return `.${escapeSelector(cls)} {
2354
- border-color: ${m[1]};${transitioned("border-color")}
2378
+ border-color: ${colorVal};${transitioned("border-color")}
2355
2379
  }`;
2356
2380
  }
2357
2381
  }
2358
- const arbFillMatch = cls.match(/^fill-\[(.+)\]$/);
2382
+ const arbRingColorMatch = cls.match(/^ring-\[(.+)\](?:\/(\d+))?$/);
2383
+ if (arbRingColorMatch) {
2384
+ const [, val, opStr] = arbRingColorMatch;
2385
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2386
+ return `.${escapeSelector(cls)} {
2387
+ --alive-ring-color: ${colorVal};
2388
+ }`;
2389
+ }
2390
+ const arbFillMatch = cls.match(/^fill-\[(.+)\](?:\/(\d+))?$/);
2359
2391
  if (arbFillMatch) {
2392
+ const [, val, opStr] = arbFillMatch;
2393
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2360
2394
  return `.${escapeSelector(cls)} {
2361
- fill: ${arbFillMatch[1]};
2395
+ fill: ${colorVal};
2362
2396
  }`;
2363
2397
  }
2364
- const arbStrokeMatch = cls.match(/^stroke-\[(.+)\]$/);
2398
+ const arbStrokeMatch = cls.match(/^stroke-\[(.+)\](?:\/(\d+))?$/);
2365
2399
  if (arbStrokeMatch) {
2400
+ const [, val, opStr] = arbStrokeMatch;
2401
+ const colorVal = opStr ? applyOpacity(val, parseInt(opStr)) : val;
2366
2402
  return `.${escapeSelector(cls)} {
2367
- stroke: ${arbStrokeMatch[1]};
2403
+ stroke: ${colorVal};
2368
2404
  }`;
2369
2405
  }
2370
2406
  return null;
@@ -2386,182 +2422,182 @@ function has(obj, key) {
2386
2422
  function matchSpacing(cls, spacing) {
2387
2423
  const pMatch = cls.match(/^p-(.+)$/);
2388
2424
  if (pMatch && has(spacing, pMatch[1])) {
2389
- return `.${cls} { padding: ${spacing[pMatch[1]]}; }`;
2425
+ return `.${escapeSelector(cls)} { padding: ${spacing[pMatch[1]]}; }`;
2390
2426
  }
2391
2427
  const pxMatch = cls.match(/^px-(.+)$/);
2392
2428
  if (pxMatch && has(spacing, pxMatch[1])) {
2393
- return `.${cls} { padding-left: ${spacing[pxMatch[1]]}; padding-right: ${spacing[pxMatch[1]]}; }`;
2429
+ return `.${escapeSelector(cls)} { padding-left: ${spacing[pxMatch[1]]}; padding-right: ${spacing[pxMatch[1]]}; }`;
2394
2430
  }
2395
2431
  const pyMatch = cls.match(/^py-(.+)$/);
2396
2432
  if (pyMatch && has(spacing, pyMatch[1])) {
2397
- return `.${cls} { padding-top: ${spacing[pyMatch[1]]}; padding-bottom: ${spacing[pyMatch[1]]}; }`;
2433
+ return `.${escapeSelector(cls)} { padding-top: ${spacing[pyMatch[1]]}; padding-bottom: ${spacing[pyMatch[1]]}; }`;
2398
2434
  }
2399
2435
  const ptMatch = cls.match(/^pt-(.+)$/);
2400
2436
  if (ptMatch && has(spacing, ptMatch[1])) {
2401
- return `.${cls} { padding-top: ${spacing[ptMatch[1]]}; }`;
2437
+ return `.${escapeSelector(cls)} { padding-top: ${spacing[ptMatch[1]]}; }`;
2402
2438
  }
2403
2439
  const prMatch = cls.match(/^pr-(.+)$/);
2404
2440
  if (prMatch && has(spacing, prMatch[1])) {
2405
- return `.${cls} { padding-right: ${spacing[prMatch[1]]}; }`;
2441
+ return `.${escapeSelector(cls)} { padding-right: ${spacing[prMatch[1]]}; }`;
2406
2442
  }
2407
2443
  const pbMatch = cls.match(/^pb-(.+)$/);
2408
2444
  if (pbMatch && has(spacing, pbMatch[1])) {
2409
- return `.${cls} { padding-bottom: ${spacing[pbMatch[1]]}; }`;
2445
+ return `.${escapeSelector(cls)} { padding-bottom: ${spacing[pbMatch[1]]}; }`;
2410
2446
  }
2411
2447
  const plMatch = cls.match(/^pl-(.+)$/);
2412
2448
  if (plMatch && has(spacing, plMatch[1])) {
2413
- return `.${cls} { padding-left: ${spacing[plMatch[1]]}; }`;
2449
+ return `.${escapeSelector(cls)} { padding-left: ${spacing[plMatch[1]]}; }`;
2414
2450
  }
2415
2451
  const mMatch = cls.match(/^m-(.+)$/);
2416
2452
  if (mMatch) {
2417
- if (mMatch[1] === "auto") return `.${cls} { margin: auto; }`;
2418
- if (has(spacing, mMatch[1])) return `.${cls} { margin: ${spacing[mMatch[1]]}; }`;
2453
+ if (mMatch[1] === "auto") return `.${escapeSelector(cls)} { margin: auto; }`;
2454
+ if (has(spacing, mMatch[1])) return `.${escapeSelector(cls)} { margin: ${spacing[mMatch[1]]}; }`;
2419
2455
  }
2420
2456
  const mxMatch = cls.match(/^mx-(.+)$/);
2421
2457
  if (mxMatch) {
2422
- if (mxMatch[1] === "auto") return `.${cls} { margin-left: auto; margin-right: auto; }`;
2423
- if (has(spacing, mxMatch[1])) return `.${cls} { margin-left: ${spacing[mxMatch[1]]}; margin-right: ${spacing[mxMatch[1]]}; }`;
2458
+ if (mxMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-left: auto; margin-right: auto; }`;
2459
+ if (has(spacing, mxMatch[1])) return `.${escapeSelector(cls)} { margin-left: ${spacing[mxMatch[1]]}; margin-right: ${spacing[mxMatch[1]]}; }`;
2424
2460
  }
2425
2461
  const myMatch = cls.match(/^my-(.+)$/);
2426
2462
  if (myMatch) {
2427
- if (myMatch[1] === "auto") return `.${cls} { margin-top: auto; margin-bottom: auto; }`;
2428
- if (has(spacing, myMatch[1])) return `.${cls} { margin-top: ${spacing[myMatch[1]]}; margin-bottom: ${spacing[myMatch[1]]}; }`;
2463
+ if (myMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-top: auto; margin-bottom: auto; }`;
2464
+ if (has(spacing, myMatch[1])) return `.${escapeSelector(cls)} { margin-top: ${spacing[myMatch[1]]}; margin-bottom: ${spacing[myMatch[1]]}; }`;
2429
2465
  }
2430
2466
  const mtMatch = cls.match(/^mt-(.+)$/);
2431
2467
  if (mtMatch) {
2432
- if (mtMatch[1] === "auto") return `.${cls} { margin-top: auto; }`;
2433
- if (has(spacing, mtMatch[1])) return `.${cls} { margin-top: ${spacing[mtMatch[1]]}; }`;
2468
+ if (mtMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-top: auto; }`;
2469
+ if (has(spacing, mtMatch[1])) return `.${escapeSelector(cls)} { margin-top: ${spacing[mtMatch[1]]}; }`;
2434
2470
  }
2435
2471
  const mrMatch = cls.match(/^mr-(.+)$/);
2436
2472
  if (mrMatch) {
2437
- if (mrMatch[1] === "auto") return `.${cls} { margin-right: auto; }`;
2438
- if (has(spacing, mrMatch[1])) return `.${cls} { margin-right: ${spacing[mrMatch[1]]}; }`;
2473
+ if (mrMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-right: auto; }`;
2474
+ if (has(spacing, mrMatch[1])) return `.${escapeSelector(cls)} { margin-right: ${spacing[mrMatch[1]]}; }`;
2439
2475
  }
2440
2476
  const mbMatch = cls.match(/^mb-(.+)$/);
2441
2477
  if (mbMatch) {
2442
- if (mbMatch[1] === "auto") return `.${cls} { margin-bottom: auto; }`;
2443
- if (has(spacing, mbMatch[1])) return `.${cls} { margin-bottom: ${spacing[mbMatch[1]]}; }`;
2478
+ if (mbMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-bottom: auto; }`;
2479
+ if (has(spacing, mbMatch[1])) return `.${escapeSelector(cls)} { margin-bottom: ${spacing[mbMatch[1]]}; }`;
2444
2480
  }
2445
2481
  const mlMatch = cls.match(/^ml-(.+)$/);
2446
2482
  if (mlMatch) {
2447
- if (mlMatch[1] === "auto") return `.${cls} { margin-left: auto; }`;
2448
- if (has(spacing, mlMatch[1])) return `.${cls} { margin-left: ${spacing[mlMatch[1]]}; }`;
2483
+ if (mlMatch[1] === "auto") return `.${escapeSelector(cls)} { margin-left: auto; }`;
2484
+ if (has(spacing, mlMatch[1])) return `.${escapeSelector(cls)} { margin-left: ${spacing[mlMatch[1]]}; }`;
2449
2485
  }
2450
2486
  const gapMatch = cls.match(/^gap-(.+)$/);
2451
2487
  if (gapMatch && has(spacing, gapMatch[1])) {
2452
- return `.${cls} { gap: ${spacing[gapMatch[1]]}; }`;
2488
+ return `.${escapeSelector(cls)} { gap: ${spacing[gapMatch[1]]}; }`;
2453
2489
  }
2454
2490
  const gapXMatch = cls.match(/^gap-x-(.+)$/);
2455
2491
  if (gapXMatch && has(spacing, gapXMatch[1])) {
2456
- return `.${cls} { column-gap: ${spacing[gapXMatch[1]]}; }`;
2492
+ return `.${escapeSelector(cls)} { column-gap: ${spacing[gapXMatch[1]]}; }`;
2457
2493
  }
2458
2494
  const gapYMatch = cls.match(/^gap-y-(.+)$/);
2459
2495
  if (gapYMatch && has(spacing, gapYMatch[1])) {
2460
- return `.${cls} { row-gap: ${spacing[gapYMatch[1]]}; }`;
2496
+ return `.${escapeSelector(cls)} { row-gap: ${spacing[gapYMatch[1]]}; }`;
2461
2497
  }
2462
2498
  const spaceXMatch = cls.match(/^space-x-(.+)$/);
2463
2499
  if (spaceXMatch && has(spacing, spaceXMatch[1])) {
2464
- return `.${cls} > * + * { margin-left: ${spacing[spaceXMatch[1]]}; }`;
2500
+ return `.${escapeSelector(cls)}> * + * { margin-left: ${spacing[spaceXMatch[1]]}; }`;
2465
2501
  }
2466
2502
  const spaceYMatch = cls.match(/^space-y-(.+)$/);
2467
2503
  if (spaceYMatch && has(spacing, spaceYMatch[1])) {
2468
- return `.${cls} > * + * { margin-top: ${spacing[spaceYMatch[1]]}; }`;
2504
+ return `.${escapeSelector(cls)}> * + * { margin-top: ${spacing[spaceYMatch[1]]}; }`;
2469
2505
  }
2470
2506
  const insetMatch = cls.match(/^inset-(.+)$/);
2471
2507
  if (insetMatch) {
2472
- if (insetMatch[1] === "auto") return `.${cls} { inset: auto; }`;
2473
- if (insetMatch[1] === "0") return `.${cls} { inset: 0px; }`;
2474
- if (has(spacing, insetMatch[1])) return `.${cls} { inset: ${spacing[insetMatch[1]]}; }`;
2508
+ if (insetMatch[1] === "auto") return `.${escapeSelector(cls)} { inset: auto; }`;
2509
+ if (insetMatch[1] === "0") return `.${escapeSelector(cls)} { inset: 0px; }`;
2510
+ if (has(spacing, insetMatch[1])) return `.${escapeSelector(cls)} { inset: ${spacing[insetMatch[1]]}; }`;
2475
2511
  }
2476
2512
  const insetXMatch = cls.match(/^inset-x-(.+)$/);
2477
2513
  if (insetXMatch) {
2478
2514
  const val = insetXMatch[1] === "auto" ? "auto" : insetXMatch[1] === "0" ? "0px" : has(spacing, insetXMatch[1]) ? spacing[insetXMatch[1]] : void 0;
2479
- if (val) return `.${cls} { left: ${val}; right: ${val}; }`;
2515
+ if (val) return `.${escapeSelector(cls)} { left: ${val}; right: ${val}; }`;
2480
2516
  }
2481
2517
  const insetYMatch = cls.match(/^inset-y-(.+)$/);
2482
2518
  if (insetYMatch) {
2483
2519
  const val = insetYMatch[1] === "auto" ? "auto" : insetYMatch[1] === "0" ? "0px" : has(spacing, insetYMatch[1]) ? spacing[insetYMatch[1]] : void 0;
2484
- if (val) return `.${cls} { top: ${val}; bottom: ${val}; }`;
2520
+ if (val) return `.${escapeSelector(cls)} { top: ${val}; bottom: ${val}; }`;
2485
2521
  }
2486
2522
  const topMatch = cls.match(/^top-(.+)$/);
2487
2523
  if (topMatch) {
2488
- if (topMatch[1] === "auto") return `.${cls} { top: auto; }`;
2489
- if (topMatch[1] === "0") return `.${cls} { top: 0px; }`;
2490
- if (has(spacing, topMatch[1])) return `.${cls} { top: ${spacing[topMatch[1]]}; }`;
2524
+ if (topMatch[1] === "auto") return `.${escapeSelector(cls)} { top: auto; }`;
2525
+ if (topMatch[1] === "0") return `.${escapeSelector(cls)} { top: 0px; }`;
2526
+ if (has(spacing, topMatch[1])) return `.${escapeSelector(cls)} { top: ${spacing[topMatch[1]]}; }`;
2491
2527
  }
2492
2528
  const rightMatch = cls.match(/^right-(.+)$/);
2493
2529
  if (rightMatch) {
2494
- if (rightMatch[1] === "auto") return `.${cls} { right: auto; }`;
2495
- if (rightMatch[1] === "0") return `.${cls} { right: 0px; }`;
2496
- if (has(spacing, rightMatch[1])) return `.${cls} { right: ${spacing[rightMatch[1]]}; }`;
2530
+ if (rightMatch[1] === "auto") return `.${escapeSelector(cls)} { right: auto; }`;
2531
+ if (rightMatch[1] === "0") return `.${escapeSelector(cls)} { right: 0px; }`;
2532
+ if (has(spacing, rightMatch[1])) return `.${escapeSelector(cls)} { right: ${spacing[rightMatch[1]]}; }`;
2497
2533
  }
2498
2534
  const bottomMatch = cls.match(/^bottom-(.+)$/);
2499
2535
  if (bottomMatch) {
2500
- if (bottomMatch[1] === "auto") return `.${cls} { bottom: auto; }`;
2501
- if (bottomMatch[1] === "0") return `.${cls} { bottom: 0px; }`;
2502
- if (has(spacing, bottomMatch[1])) return `.${cls} { bottom: ${spacing[bottomMatch[1]]}; }`;
2536
+ if (bottomMatch[1] === "auto") return `.${escapeSelector(cls)} { bottom: auto; }`;
2537
+ if (bottomMatch[1] === "0") return `.${escapeSelector(cls)} { bottom: 0px; }`;
2538
+ if (has(spacing, bottomMatch[1])) return `.${escapeSelector(cls)} { bottom: ${spacing[bottomMatch[1]]}; }`;
2503
2539
  }
2504
2540
  const leftMatch = cls.match(/^left-(.+)$/);
2505
2541
  if (leftMatch) {
2506
- if (leftMatch[1] === "auto") return `.${cls} { left: auto; }`;
2507
- if (leftMatch[1] === "0") return `.${cls} { left: 0px; }`;
2508
- if (has(spacing, leftMatch[1])) return `.${cls} { left: ${spacing[leftMatch[1]]}; }`;
2542
+ if (leftMatch[1] === "auto") return `.${escapeSelector(cls)} { left: auto; }`;
2543
+ if (leftMatch[1] === "0") return `.${escapeSelector(cls)} { left: 0px; }`;
2544
+ if (has(spacing, leftMatch[1])) return `.${escapeSelector(cls)} { left: ${spacing[leftMatch[1]]}; }`;
2509
2545
  }
2510
2546
  const negMMatch = cls.match(/^-m-(.+)$/);
2511
2547
  if (negMMatch && has(spacing, negMMatch[1])) {
2512
- return `.\\-m-${negMMatch[1]} { margin: -${spacing[negMMatch[1]]}; }`;
2548
+ return `.${escapeSelector(cls)} { margin: -${spacing[negMMatch[1]]}; }`;
2513
2549
  }
2514
2550
  const negMxMatch = cls.match(/^-mx-(.+)$/);
2515
2551
  if (negMxMatch && has(spacing, negMxMatch[1])) {
2516
- return `.\\-mx-${negMxMatch[1]} { margin-left: -${spacing[negMxMatch[1]]}; margin-right: -${spacing[negMxMatch[1]]}; }`;
2552
+ return `.${escapeSelector(cls)} { margin-left: -${spacing[negMxMatch[1]]}; margin-right: -${spacing[negMxMatch[1]]}; }`;
2517
2553
  }
2518
2554
  const negMyMatch = cls.match(/^-my-(.+)$/);
2519
2555
  if (negMyMatch && has(spacing, negMyMatch[1])) {
2520
- return `.\\-my-${negMyMatch[1]} { margin-top: -${spacing[negMyMatch[1]]}; margin-bottom: -${spacing[negMyMatch[1]]}; }`;
2556
+ return `.${escapeSelector(cls)} { margin-top: -${spacing[negMyMatch[1]]}; margin-bottom: -${spacing[negMyMatch[1]]}; }`;
2521
2557
  }
2522
2558
  const negMtMatch = cls.match(/^-mt-(.+)$/);
2523
2559
  if (negMtMatch && has(spacing, negMtMatch[1])) {
2524
- return `.\\-mt-${negMtMatch[1]} { margin-top: -${spacing[negMtMatch[1]]}; }`;
2560
+ return `.${escapeSelector(cls)} { margin-top: -${spacing[negMtMatch[1]]}; }`;
2525
2561
  }
2526
2562
  const negMrMatch = cls.match(/^-mr-(.+)$/);
2527
2563
  if (negMrMatch && has(spacing, negMrMatch[1])) {
2528
- return `.\\-mr-${negMrMatch[1]} { margin-right: -${spacing[negMrMatch[1]]}; }`;
2564
+ return `.${escapeSelector(cls)} { margin-right: -${spacing[negMrMatch[1]]}; }`;
2529
2565
  }
2530
2566
  const negMbMatch = cls.match(/^-mb-(.+)$/);
2531
2567
  if (negMbMatch && has(spacing, negMbMatch[1])) {
2532
- return `.\\-mb-${negMbMatch[1]} { margin-bottom: -${spacing[negMbMatch[1]]}; }`;
2568
+ return `.${escapeSelector(cls)} { margin-bottom: -${spacing[negMbMatch[1]]}; }`;
2533
2569
  }
2534
2570
  const negMlMatch = cls.match(/^-ml-(.+)$/);
2535
2571
  if (negMlMatch && has(spacing, negMlMatch[1])) {
2536
- return `.\\-ml-${negMlMatch[1]} { margin-left: -${spacing[negMlMatch[1]]}; }`;
2572
+ return `.${escapeSelector(cls)} { margin-left: -${spacing[negMlMatch[1]]}; }`;
2537
2573
  }
2538
2574
  const negInsetMatch = cls.match(/^-inset-(.+)$/);
2539
2575
  if (negInsetMatch && has(spacing, negInsetMatch[1])) {
2540
- return `.\\-inset-${negInsetMatch[1]} { inset: -${spacing[negInsetMatch[1]]}; }`;
2576
+ return `.${escapeSelector(cls)} { inset: -${spacing[negInsetMatch[1]]}; }`;
2541
2577
  }
2542
2578
  const negInsetXMatch = cls.match(/^-inset-x-(.+)$/);
2543
2579
  if (negInsetXMatch && has(spacing, negInsetXMatch[1])) {
2544
- return `.\\-inset-x-${negInsetXMatch[1]} { left: -${spacing[negInsetXMatch[1]]}; right: -${spacing[negInsetXMatch[1]]}; }`;
2580
+ return `.${escapeSelector(cls)} { left: -${spacing[negInsetXMatch[1]]}; right: -${spacing[negInsetXMatch[1]]}; }`;
2545
2581
  }
2546
2582
  const negInsetYMatch = cls.match(/^-inset-y-(.+)$/);
2547
2583
  if (negInsetYMatch && has(spacing, negInsetYMatch[1])) {
2548
- return `.\\-inset-y-${negInsetYMatch[1]} { top: -${spacing[negInsetYMatch[1]]}; bottom: -${spacing[negInsetYMatch[1]]}; }`;
2584
+ return `.${escapeSelector(cls)} { top: -${spacing[negInsetYMatch[1]]}; bottom: -${spacing[negInsetYMatch[1]]}; }`;
2549
2585
  }
2550
2586
  const negTopMatch = cls.match(/^-top-(.+)$/);
2551
2587
  if (negTopMatch && has(spacing, negTopMatch[1])) {
2552
- return `.\\-top-${negTopMatch[1]} { top: -${spacing[negTopMatch[1]]}; }`;
2588
+ return `.${escapeSelector(cls)} { top: -${spacing[negTopMatch[1]]}; }`;
2553
2589
  }
2554
2590
  const negRightMatch = cls.match(/^-right-(.+)$/);
2555
2591
  if (negRightMatch && has(spacing, negRightMatch[1])) {
2556
- return `.\\-right-${negRightMatch[1]} { right: -${spacing[negRightMatch[1]]}; }`;
2592
+ return `.${escapeSelector(cls)} { right: -${spacing[negRightMatch[1]]}; }`;
2557
2593
  }
2558
2594
  const negBottomMatch = cls.match(/^-bottom-(.+)$/);
2559
2595
  if (negBottomMatch && has(spacing, negBottomMatch[1])) {
2560
- return `.\\-bottom-${negBottomMatch[1]} { bottom: -${spacing[negBottomMatch[1]]}; }`;
2596
+ return `.${escapeSelector(cls)} { bottom: -${spacing[negBottomMatch[1]]}; }`;
2561
2597
  }
2562
2598
  const negLeftMatch = cls.match(/^-left-(.+)$/);
2563
2599
  if (negLeftMatch && has(spacing, negLeftMatch[1])) {
2564
- return `.\\-left-${negLeftMatch[1]} { left: -${spacing[negLeftMatch[1]]}; }`;
2600
+ return `.${escapeSelector(cls)} { left: -${spacing[negLeftMatch[1]]}; }`;
2565
2601
  }
2566
2602
  const arbSpacingMatch = cls.match(/^(w|h|p|m|pt|pr|pb|pl|px|py|mt|mr|mb|ml|mx|my|gap|gap-x|gap-y|top|right|bottom|left|inset|inset-x|inset-y)-\[(.+)\]$/);
2567
2603
  if (arbSpacingMatch) {
@@ -2642,21 +2678,21 @@ function matchTypography(cls, fontSize, fontWeight, lineHeight) {
2642
2678
  const textSizeMatch = cls.match(/^text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)$/);
2643
2679
  if (textSizeMatch && hasOwn(fontSize, textSizeMatch[1])) {
2644
2680
  const [size, lh] = fontSize[textSizeMatch[1]];
2645
- return `.${cls} {
2681
+ return `.${escapeSelector(cls)} {
2646
2682
  font-size: ${size};
2647
2683
  line-height: ${lh};
2648
2684
  }`;
2649
2685
  }
2650
2686
  const fontWeightMatch = cls.match(/^font-(thin|extralight|light|normal|medium|semibold|bold|extrabold|black)$/);
2651
2687
  if (fontWeightMatch && hasOwn(fontWeight, fontWeightMatch[1])) {
2652
- return `.${cls} { font-weight: ${fontWeight[fontWeightMatch[1]]}; }`;
2688
+ return `.${escapeSelector(cls)} { font-weight: ${fontWeight[fontWeightMatch[1]]}; }`;
2653
2689
  }
2654
- if (cls === "font-sans") return `.${cls} { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }`;
2655
- if (cls === "font-serif") return `.${cls} { font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; }`;
2656
- if (cls === "font-mono") return `.${cls} { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }`;
2690
+ if (cls === "font-sans") return `.${escapeSelector(cls)} { font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; }`;
2691
+ if (cls === "font-serif") return `.${escapeSelector(cls)} { font-family: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif; }`;
2692
+ if (cls === "font-mono") return `.${escapeSelector(cls)} { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; }`;
2657
2693
  const leadingMatch = cls.match(/^leading-(.+)$/);
2658
2694
  if (leadingMatch && hasOwn(lineHeight, leadingMatch[1])) {
2659
- return `.${cls} { line-height: ${lineHeight[leadingMatch[1]]}; }`;
2695
+ return `.${escapeSelector(cls)} { line-height: ${lineHeight[leadingMatch[1]]}; }`;
2660
2696
  }
2661
2697
  const trackingMap = {
2662
2698
  tighter: "-0.05em",
@@ -2668,42 +2704,42 @@ function matchTypography(cls, fontSize, fontWeight, lineHeight) {
2668
2704
  };
2669
2705
  const trackingMatch = cls.match(/^tracking-(.+)$/);
2670
2706
  if (trackingMatch && Object.prototype.hasOwnProperty.call(trackingMap, trackingMatch[1])) {
2671
- return `.${cls} { letter-spacing: ${trackingMap[trackingMatch[1]]}; }`;
2672
- }
2673
- if (cls === "text-left") return `.${cls} { text-align: left; }`;
2674
- if (cls === "text-center") return `.${cls} { text-align: center; }`;
2675
- if (cls === "text-right") return `.${cls} { text-align: right; }`;
2676
- if (cls === "text-justify") return `.${cls} { text-align: justify; }`;
2677
- if (cls === "text-start") return `.${cls} { text-align: start; }`;
2678
- if (cls === "text-end") return `.${cls} { text-align: end; }`;
2679
- if (cls === "uppercase") return `.${cls} { text-transform: uppercase; }`;
2680
- if (cls === "lowercase") return `.${cls} { text-transform: lowercase; }`;
2681
- if (cls === "capitalize") return `.${cls} { text-transform: capitalize; }`;
2682
- if (cls === "normal-case") return `.${cls} { text-transform: none; }`;
2683
- if (cls === "underline") return `.${cls} { text-decoration-line: underline; }`;
2684
- if (cls === "overline") return `.${cls} { text-decoration-line: overline; }`;
2685
- if (cls === "line-through") return `.${cls} { text-decoration-line: line-through; }`;
2686
- if (cls === "no-underline") return `.${cls} { text-decoration-line: none; }`;
2687
- if (cls === "truncate") return `.${cls} { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }`;
2688
- if (cls === "text-ellipsis") return `.${cls} { text-overflow: ellipsis; }`;
2689
- if (cls === "text-clip") return `.${cls} { text-overflow: clip; }`;
2690
- if (cls === "whitespace-normal") return `.${cls} { white-space: normal; }`;
2691
- if (cls === "whitespace-nowrap") return `.${cls} { white-space: nowrap; }`;
2692
- if (cls === "whitespace-pre") return `.${cls} { white-space: pre; }`;
2693
- if (cls === "whitespace-pre-line") return `.${cls} { white-space: pre-line; }`;
2694
- if (cls === "whitespace-pre-wrap") return `.${cls} { white-space: pre-wrap; }`;
2695
- if (cls === "whitespace-break-spaces") return `.${cls} { white-space: break-spaces; }`;
2696
- if (cls === "italic") return `.${cls} { font-style: italic; }`;
2697
- if (cls === "not-italic") return `.${cls} { font-style: normal; }`;
2698
- if (cls === "tabular-nums") return `.${cls} { font-variant-numeric: tabular-nums; }`;
2699
- if (cls === "oldstyle-nums") return `.${cls} { font-variant-numeric: oldstyle-nums; }`;
2700
- if (cls === "list-none") return `.${cls} { list-style-type: none; }`;
2701
- if (cls === "list-disc") return `.${cls} { list-style-type: disc; }`;
2702
- if (cls === "list-decimal") return `.${cls} { list-style-type: decimal; }`;
2703
- if (cls === "break-normal") return `.${cls} { overflow-wrap: normal; word-break: normal; }`;
2704
- if (cls === "break-words") return `.${cls} { overflow-wrap: break-word; }`;
2705
- if (cls === "break-all") return `.${cls} { word-break: break-all; }`;
2706
- if (cls === "break-keep") return `.${cls} { word-break: keep-all; }`;
2707
+ return `.${escapeSelector(cls)} { letter-spacing: ${trackingMap[trackingMatch[1]]}; }`;
2708
+ }
2709
+ if (cls === "text-left") return `.${escapeSelector(cls)} { text-align: left; }`;
2710
+ if (cls === "text-center") return `.${escapeSelector(cls)} { text-align: center; }`;
2711
+ if (cls === "text-right") return `.${escapeSelector(cls)} { text-align: right; }`;
2712
+ if (cls === "text-justify") return `.${escapeSelector(cls)} { text-align: justify; }`;
2713
+ if (cls === "text-start") return `.${escapeSelector(cls)} { text-align: start; }`;
2714
+ if (cls === "text-end") return `.${escapeSelector(cls)} { text-align: end; }`;
2715
+ if (cls === "uppercase") return `.${escapeSelector(cls)} { text-transform: uppercase; }`;
2716
+ if (cls === "lowercase") return `.${escapeSelector(cls)} { text-transform: lowercase; }`;
2717
+ if (cls === "capitalize") return `.${escapeSelector(cls)} { text-transform: capitalize; }`;
2718
+ if (cls === "normal-case") return `.${escapeSelector(cls)} { text-transform: none; }`;
2719
+ if (cls === "underline") return `.${escapeSelector(cls)} { text-decoration-line: underline; }`;
2720
+ if (cls === "overline") return `.${escapeSelector(cls)} { text-decoration-line: overline; }`;
2721
+ if (cls === "line-through") return `.${escapeSelector(cls)} { text-decoration-line: line-through; }`;
2722
+ if (cls === "no-underline") return `.${escapeSelector(cls)} { text-decoration-line: none; }`;
2723
+ if (cls === "truncate") return `.${escapeSelector(cls)} { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }`;
2724
+ if (cls === "text-ellipsis") return `.${escapeSelector(cls)} { text-overflow: ellipsis; }`;
2725
+ if (cls === "text-clip") return `.${escapeSelector(cls)} { text-overflow: clip; }`;
2726
+ if (cls === "whitespace-normal") return `.${escapeSelector(cls)} { white-space: normal; }`;
2727
+ if (cls === "whitespace-nowrap") return `.${escapeSelector(cls)} { white-space: nowrap; }`;
2728
+ if (cls === "whitespace-pre") return `.${escapeSelector(cls)} { white-space: pre; }`;
2729
+ if (cls === "whitespace-pre-line") return `.${escapeSelector(cls)} { white-space: pre-line; }`;
2730
+ if (cls === "whitespace-pre-wrap") return `.${escapeSelector(cls)} { white-space: pre-wrap; }`;
2731
+ if (cls === "whitespace-break-spaces") return `.${escapeSelector(cls)} { white-space: break-spaces; }`;
2732
+ if (cls === "italic") return `.${escapeSelector(cls)} { font-style: italic; }`;
2733
+ if (cls === "not-italic") return `.${escapeSelector(cls)} { font-style: normal; }`;
2734
+ if (cls === "tabular-nums") return `.${escapeSelector(cls)} { font-variant-numeric: tabular-nums; }`;
2735
+ if (cls === "oldstyle-nums") return `.${escapeSelector(cls)} { font-variant-numeric: oldstyle-nums; }`;
2736
+ if (cls === "list-none") return `.${escapeSelector(cls)} { list-style-type: none; }`;
2737
+ if (cls === "list-disc") return `.${escapeSelector(cls)} { list-style-type: disc; }`;
2738
+ if (cls === "list-decimal") return `.${escapeSelector(cls)} { list-style-type: decimal; }`;
2739
+ if (cls === "break-normal") return `.${escapeSelector(cls)} { overflow-wrap: normal; word-break: normal; }`;
2740
+ if (cls === "break-words") return `.${escapeSelector(cls)} { overflow-wrap: break-word; }`;
2741
+ if (cls === "break-all") return `.${escapeSelector(cls)} { word-break: break-all; }`;
2742
+ if (cls === "break-keep") return `.${escapeSelector(cls)} { word-break: keep-all; }`;
2707
2743
  return null;
2708
2744
  }
2709
2745
 
@@ -2729,7 +2765,7 @@ function matchLayout(cls) {
2729
2765
  hidden: "display: none;",
2730
2766
  contents: "display: contents;"
2731
2767
  };
2732
- if (displayMap[cls]) return `.${cls} { ${displayMap[cls]} }`;
2768
+ if (displayMap[cls]) return `.${escapeSelector(cls)} { ${displayMap[cls]} }`;
2733
2769
  const posMap = {
2734
2770
  static: "position: static;",
2735
2771
  relative: "position: relative;",
@@ -2737,111 +2773,115 @@ function matchLayout(cls) {
2737
2773
  fixed: "position: fixed;",
2738
2774
  sticky: "position: sticky;"
2739
2775
  };
2740
- if (posMap[cls]) return `.${cls} { ${posMap[cls]} }`;
2741
- if (cls === "flex-row") return `.${cls} { flex-direction: row; }`;
2742
- if (cls === "flex-row-reverse") return `.${cls} { flex-direction: row-reverse; }`;
2743
- if (cls === "flex-col") return `.${cls} { flex-direction: column; }`;
2744
- if (cls === "flex-col-reverse") return `.${cls} { flex-direction: column-reverse; }`;
2745
- if (cls === "flex-wrap") return `.${cls} { flex-wrap: wrap; }`;
2746
- if (cls === "flex-nowrap") return `.${cls} { flex-wrap: nowrap; }`;
2747
- if (cls === "flex-wrap-reverse") return `.${cls} { flex-wrap: wrap-reverse; }`;
2748
- if (cls === "flex-1") return `.${cls} { flex: 1 1 0%; }`;
2749
- if (cls === "flex-auto") return `.${cls} { flex: 1 1 auto; }`;
2750
- if (cls === "flex-initial") return `.${cls} { flex: 0 1 auto; }`;
2751
- if (cls === "flex-none") return `.${cls} { flex: none; }`;
2752
- if (cls === "flex-grow") return `.${cls} { flex-grow: 1; }`;
2753
- if (cls === "flex-grow-0") return `.${cls} { flex-grow: 0; }`;
2754
- if (cls === "flex-shrink") return `.${cls} { flex-shrink: 1; }`;
2755
- if (cls === "flex-shrink-0") return `.${cls} { flex-shrink: 0; }`;
2756
- if (cls === "items-start") return `.${cls} { align-items: flex-start; }`;
2757
- if (cls === "items-end") return `.${cls} { align-items: flex-end; }`;
2758
- if (cls === "items-center") return `.${cls} { align-items: center; }`;
2759
- if (cls === "items-baseline") return `.${cls} { align-items: baseline; }`;
2760
- if (cls === "items-stretch") return `.${cls} { align-items: stretch; }`;
2761
- if (cls === "self-auto") return `.${cls} { align-self: auto; }`;
2762
- if (cls === "self-start") return `.${cls} { align-self: flex-start; }`;
2763
- if (cls === "self-end") return `.${cls} { align-self: flex-end; }`;
2764
- if (cls === "self-center") return `.${cls} { align-self: center; }`;
2765
- if (cls === "self-stretch") return `.${cls} { align-self: stretch; }`;
2766
- if (cls === "self-baseline") return `.${cls} { align-self: baseline; }`;
2767
- if (cls === "justify-start") return `.${cls} { justify-content: flex-start; }`;
2768
- if (cls === "justify-end") return `.${cls} { justify-content: flex-end; }`;
2769
- if (cls === "justify-center") return `.${cls} { justify-content: center; }`;
2770
- if (cls === "justify-between") return `.${cls} { justify-content: space-between; }`;
2771
- if (cls === "justify-around") return `.${cls} { justify-content: space-around; }`;
2772
- if (cls === "justify-evenly") return `.${cls} { justify-content: space-evenly; }`;
2773
- if (cls === "justify-stretch") return `.${cls} { justify-content: stretch; }`;
2774
- if (cls === "justify-items-start") return `.${cls} { justify-items: start; }`;
2775
- if (cls === "justify-items-end") return `.${cls} { justify-items: end; }`;
2776
- if (cls === "justify-items-center") return `.${cls} { justify-items: center; }`;
2777
- if (cls === "justify-items-stretch") return `.${cls} { justify-items: stretch; }`;
2778
- if (cls === "justify-self-auto") return `.${cls} { justify-self: auto; }`;
2779
- if (cls === "justify-self-start") return `.${cls} { justify-self: start; }`;
2780
- if (cls === "justify-self-end") return `.${cls} { justify-self: end; }`;
2781
- if (cls === "justify-self-center") return `.${cls} { justify-self: center; }`;
2782
- if (cls === "justify-self-stretch") return `.${cls} { justify-self: stretch; }`;
2783
- if (cls === "content-normal") return `.${cls} { align-content: normal; }`;
2784
- if (cls === "content-center") return `.${cls} { align-content: center; }`;
2785
- if (cls === "content-start") return `.${cls} { align-content: flex-start; }`;
2786
- if (cls === "content-end") return `.${cls} { align-content: flex-end; }`;
2787
- if (cls === "content-between") return `.${cls} { align-content: space-between; }`;
2788
- if (cls === "content-around") return `.${cls} { align-content: space-around; }`;
2789
- if (cls === "content-evenly") return `.${cls} { align-content: space-evenly; }`;
2790
- if (cls === "content-stretch") return `.${cls} { align-content: stretch; }`;
2791
- if (cls === "content-baseline") return `.${cls} { align-content: baseline; }`;
2776
+ if (posMap[cls]) return `.${escapeSelector(cls)} { ${posMap[cls]} }`;
2777
+ if (cls === "flex-row") return `.${escapeSelector(cls)} { flex-direction: row; }`;
2778
+ if (cls === "flex-row-reverse") return `.${escapeSelector(cls)} { flex-direction: row-reverse; }`;
2779
+ if (cls === "flex-col") return `.${escapeSelector(cls)} { flex-direction: column; }`;
2780
+ if (cls === "flex-col-reverse") return `.${escapeSelector(cls)} { flex-direction: column-reverse; }`;
2781
+ if (cls === "flex-wrap") return `.${escapeSelector(cls)} { flex-wrap: wrap; }`;
2782
+ if (cls === "flex-nowrap") return `.${escapeSelector(cls)} { flex-wrap: nowrap; }`;
2783
+ if (cls === "flex-wrap-reverse") return `.${escapeSelector(cls)} { flex-wrap: wrap-reverse; }`;
2784
+ if (cls === "flex-1") return `.${escapeSelector(cls)} { flex: 1 1 0%; }`;
2785
+ if (cls === "flex-auto") return `.${escapeSelector(cls)} { flex: 1 1 auto; }`;
2786
+ if (cls === "flex-initial") return `.${escapeSelector(cls)} { flex: 0 1 auto; }`;
2787
+ if (cls === "flex-none") return `.${escapeSelector(cls)} { flex: none; }`;
2788
+ if (cls === "flex-grow") return `.${escapeSelector(cls)} { flex-grow: 1; }`;
2789
+ if (cls === "flex-grow-0") return `.${escapeSelector(cls)} { flex-grow: 0; }`;
2790
+ if (cls === "flex-shrink") return `.${escapeSelector(cls)} { flex-shrink: 1; }`;
2791
+ if (cls === "flex-shrink-0") return `.${escapeSelector(cls)} { flex-shrink: 0; }`;
2792
+ if (cls === "grow") return `.${escapeSelector(cls)} { flex-grow: 1; }`;
2793
+ if (cls === "grow-0") return `.${escapeSelector(cls)} { flex-grow: 0; }`;
2794
+ if (cls === "shrink") return `.${escapeSelector(cls)} { flex-shrink: 1; }`;
2795
+ if (cls === "shrink-0") return `.${escapeSelector(cls)} { flex-shrink: 0; }`;
2796
+ if (cls === "items-start") return `.${escapeSelector(cls)} { align-items: flex-start; }`;
2797
+ if (cls === "items-end") return `.${escapeSelector(cls)} { align-items: flex-end; }`;
2798
+ if (cls === "items-center") return `.${escapeSelector(cls)} { align-items: center; }`;
2799
+ if (cls === "items-baseline") return `.${escapeSelector(cls)} { align-items: baseline; }`;
2800
+ if (cls === "items-stretch") return `.${escapeSelector(cls)} { align-items: stretch; }`;
2801
+ if (cls === "self-auto") return `.${escapeSelector(cls)} { align-self: auto; }`;
2802
+ if (cls === "self-start") return `.${escapeSelector(cls)} { align-self: flex-start; }`;
2803
+ if (cls === "self-end") return `.${escapeSelector(cls)} { align-self: flex-end; }`;
2804
+ if (cls === "self-center") return `.${escapeSelector(cls)} { align-self: center; }`;
2805
+ if (cls === "self-stretch") return `.${escapeSelector(cls)} { align-self: stretch; }`;
2806
+ if (cls === "self-baseline") return `.${escapeSelector(cls)} { align-self: baseline; }`;
2807
+ if (cls === "justify-start") return `.${escapeSelector(cls)} { justify-content: flex-start; }`;
2808
+ if (cls === "justify-end") return `.${escapeSelector(cls)} { justify-content: flex-end; }`;
2809
+ if (cls === "justify-center") return `.${escapeSelector(cls)} { justify-content: center; }`;
2810
+ if (cls === "justify-between") return `.${escapeSelector(cls)} { justify-content: space-between; }`;
2811
+ if (cls === "justify-around") return `.${escapeSelector(cls)} { justify-content: space-around; }`;
2812
+ if (cls === "justify-evenly") return `.${escapeSelector(cls)} { justify-content: space-evenly; }`;
2813
+ if (cls === "justify-stretch") return `.${escapeSelector(cls)} { justify-content: stretch; }`;
2814
+ if (cls === "justify-items-start") return `.${escapeSelector(cls)} { justify-items: start; }`;
2815
+ if (cls === "justify-items-end") return `.${escapeSelector(cls)} { justify-items: end; }`;
2816
+ if (cls === "justify-items-center") return `.${escapeSelector(cls)} { justify-items: center; }`;
2817
+ if (cls === "justify-items-stretch") return `.${escapeSelector(cls)} { justify-items: stretch; }`;
2818
+ if (cls === "justify-self-auto") return `.${escapeSelector(cls)} { justify-self: auto; }`;
2819
+ if (cls === "justify-self-start") return `.${escapeSelector(cls)} { justify-self: start; }`;
2820
+ if (cls === "justify-self-end") return `.${escapeSelector(cls)} { justify-self: end; }`;
2821
+ if (cls === "justify-self-center") return `.${escapeSelector(cls)} { justify-self: center; }`;
2822
+ if (cls === "justify-self-stretch") return `.${escapeSelector(cls)} { justify-self: stretch; }`;
2823
+ if (cls === "content-normal") return `.${escapeSelector(cls)} { align-content: normal; }`;
2824
+ if (cls === "content-center") return `.${escapeSelector(cls)} { align-content: center; }`;
2825
+ if (cls === "content-start") return `.${escapeSelector(cls)} { align-content: flex-start; }`;
2826
+ if (cls === "content-end") return `.${escapeSelector(cls)} { align-content: flex-end; }`;
2827
+ if (cls === "content-between") return `.${escapeSelector(cls)} { align-content: space-between; }`;
2828
+ if (cls === "content-around") return `.${escapeSelector(cls)} { align-content: space-around; }`;
2829
+ if (cls === "content-evenly") return `.${escapeSelector(cls)} { align-content: space-evenly; }`;
2830
+ if (cls === "content-stretch") return `.${escapeSelector(cls)} { align-content: stretch; }`;
2831
+ if (cls === "content-baseline") return `.${escapeSelector(cls)} { align-content: baseline; }`;
2792
2832
  const gridColsMatch = cls.match(/^grid-cols-(\d+)$/);
2793
2833
  if (gridColsMatch) {
2794
2834
  const n = parseInt(gridColsMatch[1]);
2795
- return `.${cls} { grid-template-columns: repeat(${n}, minmax(0, 1fr)); }`;
2835
+ return `.${escapeSelector(cls)} { grid-template-columns: repeat(${n}, minmax(0, 1fr)); }`;
2796
2836
  }
2797
- if (cls === "grid-cols-none") return `.${cls} { grid-template-columns: none; }`;
2837
+ if (cls === "grid-cols-none") return `.${escapeSelector(cls)} { grid-template-columns: none; }`;
2798
2838
  const gridRowsMatch = cls.match(/^grid-rows-(\d+)$/);
2799
2839
  if (gridRowsMatch) {
2800
2840
  const n = parseInt(gridRowsMatch[1]);
2801
- return `.${cls} { grid-template-rows: repeat(${n}, minmax(0, 1fr)); }`;
2841
+ return `.${escapeSelector(cls)} { grid-template-rows: repeat(${n}, minmax(0, 1fr)); }`;
2802
2842
  }
2803
- if (cls === "grid-rows-none") return `.${cls} { grid-template-rows: none; }`;
2843
+ if (cls === "grid-rows-none") return `.${escapeSelector(cls)} { grid-template-rows: none; }`;
2804
2844
  const colSpanMatch = cls.match(/^col-span-(\d+)$/);
2805
- if (colSpanMatch) return `.${cls} { grid-column: span ${colSpanMatch[1]} / span ${colSpanMatch[1]}; }`;
2806
- if (cls === "col-span-full") return `.${cls} { grid-column: 1 / -1; }`;
2807
- if (cls === "col-auto") return `.${cls} { grid-column: auto; }`;
2845
+ if (colSpanMatch) return `.${escapeSelector(cls)} { grid-column: span ${colSpanMatch[1]} / span ${colSpanMatch[1]}; }`;
2846
+ if (cls === "col-span-full") return `.${escapeSelector(cls)} { grid-column: 1 / -1; }`;
2847
+ if (cls === "col-auto") return `.${escapeSelector(cls)} { grid-column: auto; }`;
2808
2848
  const rowSpanMatch = cls.match(/^row-span-(\d+)$/);
2809
- if (rowSpanMatch) return `.${cls} { grid-row: span ${rowSpanMatch[1]} / span ${rowSpanMatch[1]}; }`;
2810
- if (cls === "row-span-full") return `.${cls} { grid-row: 1 / -1; }`;
2811
- if (cls === "row-auto") return `.${cls} { grid-row: auto; }`;
2849
+ if (rowSpanMatch) return `.${escapeSelector(cls)} { grid-row: span ${rowSpanMatch[1]} / span ${rowSpanMatch[1]}; }`;
2850
+ if (cls === "row-span-full") return `.${escapeSelector(cls)} { grid-row: 1 / -1; }`;
2851
+ if (cls === "row-auto") return `.${escapeSelector(cls)} { grid-row: auto; }`;
2812
2852
  const colStartMatch = cls.match(/^col-start-(\d+)$/);
2813
- if (colStartMatch) return `.${cls} { grid-column-start: ${colStartMatch[1]}; }`;
2853
+ if (colStartMatch) return `.${escapeSelector(cls)} { grid-column-start: ${colStartMatch[1]}; }`;
2814
2854
  const colEndMatch = cls.match(/^col-end-(\d+)$/);
2815
- if (colEndMatch) return `.${cls} { grid-column-end: ${colEndMatch[1]}; }`;
2855
+ if (colEndMatch) return `.${escapeSelector(cls)} { grid-column-end: ${colEndMatch[1]}; }`;
2816
2856
  const rowStartMatch = cls.match(/^row-start-(\d+)$/);
2817
- if (rowStartMatch) return `.${cls} { grid-row-start: ${rowStartMatch[1]}; }`;
2857
+ if (rowStartMatch) return `.${escapeSelector(cls)} { grid-row-start: ${rowStartMatch[1]}; }`;
2818
2858
  const rowEndMatch = cls.match(/^row-end-(\d+)$/);
2819
- if (rowEndMatch) return `.${cls} { grid-row-end: ${rowEndMatch[1]}; }`;
2859
+ if (rowEndMatch) return `.${escapeSelector(cls)} { grid-row-end: ${rowEndMatch[1]}; }`;
2820
2860
  const orderMatch = cls.match(/^order-(-?\d+)$/);
2821
- if (orderMatch) return `.${cls} { order: ${orderMatch[1]}; }`;
2822
- if (cls === "order-first") return `.${cls} { order: -9999; }`;
2823
- if (cls === "order-last") return `.${cls} { order: 9999; }`;
2824
- if (cls === "order-none") return `.${cls} { order: 0; }`;
2825
- if (cls === "float-right") return `.${cls} { float: right; }`;
2826
- if (cls === "float-left") return `.${cls} { float: left; }`;
2827
- if (cls === "float-none") return `.${cls} { float: none; }`;
2861
+ if (orderMatch) return `.${escapeSelector(cls)} { order: ${orderMatch[1]}; }`;
2862
+ if (cls === "order-first") return `.${escapeSelector(cls)} { order: -9999; }`;
2863
+ if (cls === "order-last") return `.${escapeSelector(cls)} { order: 9999; }`;
2864
+ if (cls === "order-none") return `.${escapeSelector(cls)} { order: 0; }`;
2865
+ if (cls === "float-right") return `.${escapeSelector(cls)} { float: right; }`;
2866
+ if (cls === "float-left") return `.${escapeSelector(cls)} { float: left; }`;
2867
+ if (cls === "float-none") return `.${escapeSelector(cls)} { float: none; }`;
2828
2868
  if (cls === "clearfix") return `.${cls}::after { content: ""; display: table; clear: both; }`;
2829
- if (cls === "overflow-auto") return `.${cls} { overflow: auto; }`;
2830
- if (cls === "overflow-hidden") return `.${cls} { overflow: hidden; }`;
2831
- if (cls === "overflow-clip") return `.${cls} { overflow: clip; }`;
2832
- if (cls === "overflow-visible") return `.${cls} { overflow: visible; }`;
2833
- if (cls === "overflow-scroll") return `.${cls} { overflow: scroll; }`;
2834
- if (cls === "overflow-x-auto") return `.${cls} { overflow-x: auto; }`;
2835
- if (cls === "overflow-x-hidden") return `.${cls} { overflow-x: hidden; }`;
2836
- if (cls === "overflow-x-scroll") return `.${cls} { overflow-x: scroll; }`;
2837
- if (cls === "overflow-y-auto") return `.${cls} { overflow-y: auto; }`;
2838
- if (cls === "overflow-y-hidden") return `.${cls} { overflow-y: hidden; }`;
2839
- if (cls === "overflow-y-scroll") return `.${cls} { overflow-y: scroll; }`;
2840
- if (cls === "visible") return `.${cls} { visibility: visible; }`;
2841
- if (cls === "invisible") return `.${cls} { visibility: hidden; }`;
2842
- if (cls === "collapse") return `.${cls} { visibility: collapse; }`;
2843
- if (cls === "pointer-events-none") return `.${cls} { pointer-events: none; }`;
2844
- if (cls === "pointer-events-auto") return `.${cls} { pointer-events: auto; }`;
2869
+ if (cls === "overflow-auto") return `.${escapeSelector(cls)} { overflow: auto; }`;
2870
+ if (cls === "overflow-hidden") return `.${escapeSelector(cls)} { overflow: hidden; }`;
2871
+ if (cls === "overflow-clip") return `.${escapeSelector(cls)} { overflow: clip; }`;
2872
+ if (cls === "overflow-visible") return `.${escapeSelector(cls)} { overflow: visible; }`;
2873
+ if (cls === "overflow-scroll") return `.${escapeSelector(cls)} { overflow: scroll; }`;
2874
+ if (cls === "overflow-x-auto") return `.${escapeSelector(cls)} { overflow-x: auto; }`;
2875
+ if (cls === "overflow-x-hidden") return `.${escapeSelector(cls)} { overflow-x: hidden; }`;
2876
+ if (cls === "overflow-x-scroll") return `.${escapeSelector(cls)} { overflow-x: scroll; }`;
2877
+ if (cls === "overflow-y-auto") return `.${escapeSelector(cls)} { overflow-y: auto; }`;
2878
+ if (cls === "overflow-y-hidden") return `.${escapeSelector(cls)} { overflow-y: hidden; }`;
2879
+ if (cls === "overflow-y-scroll") return `.${escapeSelector(cls)} { overflow-y: scroll; }`;
2880
+ if (cls === "visible") return `.${escapeSelector(cls)} { visibility: visible; }`;
2881
+ if (cls === "invisible") return `.${escapeSelector(cls)} { visibility: hidden; }`;
2882
+ if (cls === "collapse") return `.${escapeSelector(cls)} { visibility: collapse; }`;
2883
+ if (cls === "pointer-events-none") return `.${escapeSelector(cls)} { pointer-events: none; }`;
2884
+ if (cls === "pointer-events-auto") return `.${escapeSelector(cls)} { pointer-events: auto; }`;
2845
2885
  const cursorMap = {
2846
2886
  "cursor-auto": "auto",
2847
2887
  "cursor-default": "default",
@@ -2858,30 +2898,30 @@ function matchLayout(cls) {
2858
2898
  "cursor-zoom-in": "zoom-in",
2859
2899
  "cursor-zoom-out": "zoom-out"
2860
2900
  };
2861
- if (cursorMap[cls]) return `.${cls} { cursor: ${cursorMap[cls]}; }`;
2862
- if (cls === "select-none") return `.${cls} { user-select: none; }`;
2863
- if (cls === "select-text") return `.${cls} { user-select: text; }`;
2864
- if (cls === "select-all") return `.${cls} { user-select: all; }`;
2865
- if (cls === "select-auto") return `.${cls} { user-select: auto; }`;
2866
- if (cls === "object-contain") return `.${cls} { object-fit: contain; }`;
2867
- if (cls === "object-cover") return `.${cls} { object-fit: cover; }`;
2868
- if (cls === "object-fill") return `.${cls} { object-fit: fill; }`;
2869
- if (cls === "object-none") return `.${cls} { object-fit: none; }`;
2870
- if (cls === "object-scale-down") return `.${cls} { object-fit: scale-down; }`;
2871
- if (cls === "aspect-auto") return `.${cls} { aspect-ratio: auto; }`;
2872
- if (cls === "aspect-square") return `.${cls} { aspect-ratio: 1 / 1; }`;
2873
- if (cls === "aspect-video") return `.${cls} { aspect-ratio: 16 / 9; }`;
2901
+ if (cursorMap[cls]) return `.${escapeSelector(cls)} { cursor: ${cursorMap[cls]}; }`;
2902
+ if (cls === "select-none") return `.${escapeSelector(cls)} { user-select: none; }`;
2903
+ if (cls === "select-text") return `.${escapeSelector(cls)} { user-select: text; }`;
2904
+ if (cls === "select-all") return `.${escapeSelector(cls)} { user-select: all; }`;
2905
+ if (cls === "select-auto") return `.${escapeSelector(cls)} { user-select: auto; }`;
2906
+ if (cls === "object-contain") return `.${escapeSelector(cls)} { object-fit: contain; }`;
2907
+ if (cls === "object-cover") return `.${escapeSelector(cls)} { object-fit: cover; }`;
2908
+ if (cls === "object-fill") return `.${escapeSelector(cls)} { object-fit: fill; }`;
2909
+ if (cls === "object-none") return `.${escapeSelector(cls)} { object-fit: none; }`;
2910
+ if (cls === "object-scale-down") return `.${escapeSelector(cls)} { object-fit: scale-down; }`;
2911
+ if (cls === "aspect-auto") return `.${escapeSelector(cls)} { aspect-ratio: auto; }`;
2912
+ if (cls === "aspect-square") return `.${escapeSelector(cls)} { aspect-ratio: 1 / 1; }`;
2913
+ if (cls === "aspect-video") return `.${escapeSelector(cls)} { aspect-ratio: 16 / 9; }`;
2874
2914
  if (cls === "container") {
2875
- return `.${cls} {
2915
+ return `.${escapeSelector(cls)} {
2876
2916
  width: 100%;
2877
2917
  margin-left: auto;
2878
2918
  margin-right: auto;
2879
2919
  }`;
2880
2920
  }
2881
- if (cls === "box-border") return `.${cls} { box-sizing: border-box; }`;
2882
- if (cls === "box-content") return `.${cls} { box-sizing: content-box; }`;
2883
- if (cls === "isolate") return `.${cls} { isolation: isolate; }`;
2884
- if (cls === "isolation-auto") return `.${cls} { isolation: auto; }`;
2921
+ if (cls === "box-border") return `.${escapeSelector(cls)} { box-sizing: border-box; }`;
2922
+ if (cls === "box-content") return `.${escapeSelector(cls)} { box-sizing: content-box; }`;
2923
+ if (cls === "isolate") return `.${escapeSelector(cls)} { isolation: isolate; }`;
2924
+ if (cls === "isolation-auto") return `.${escapeSelector(cls)} { isolation: auto; }`;
2885
2925
  const mixBlendMap = {
2886
2926
  "mix-blend-normal": "normal",
2887
2927
  "mix-blend-multiply": "multiply",
@@ -2896,35 +2936,35 @@ function matchLayout(cls) {
2896
2936
  "mix-blend-difference": "difference",
2897
2937
  "mix-blend-exclusion": "exclusion"
2898
2938
  };
2899
- if (mixBlendMap[cls]) return `.${cls} { mix-blend-mode: ${mixBlendMap[cls]}; }`;
2900
- if (cls === "bg-auto") return `.${cls} { background-size: auto; }`;
2901
- if (cls === "bg-cover") return `.${cls} { background-size: cover; }`;
2902
- if (cls === "bg-contain") return `.${cls} { background-size: contain; }`;
2903
- if (cls === "bg-center") return `.${cls} { background-position: center; }`;
2904
- if (cls === "bg-top") return `.${cls} { background-position: top; }`;
2905
- if (cls === "bg-bottom") return `.${cls} { background-position: bottom; }`;
2906
- if (cls === "bg-left") return `.${cls} { background-position: left; }`;
2907
- if (cls === "bg-right") return `.${cls} { background-position: right; }`;
2908
- if (cls === "bg-left-top") return `.${cls} { background-position: left top; }`;
2909
- if (cls === "bg-left-bottom") return `.${cls} { background-position: left bottom; }`;
2910
- if (cls === "bg-right-top") return `.${cls} { background-position: right top; }`;
2911
- if (cls === "bg-right-bottom") return `.${cls} { background-position: right bottom; }`;
2912
- if (cls === "bg-repeat") return `.${cls} { background-repeat: repeat; }`;
2913
- if (cls === "bg-no-repeat") return `.${cls} { background-repeat: no-repeat; }`;
2914
- if (cls === "bg-repeat-x") return `.${cls} { background-repeat: repeat-x; }`;
2915
- if (cls === "bg-repeat-y") return `.${cls} { background-repeat: repeat-y; }`;
2916
- if (cls === "bg-repeat-round") return `.${cls} { background-repeat: round; }`;
2917
- if (cls === "bg-repeat-space") return `.${cls} { background-repeat: space; }`;
2918
- if (cls === "bg-fixed") return `.${cls} { background-attachment: fixed; }`;
2919
- if (cls === "bg-local") return `.${cls} { background-attachment: local; }`;
2920
- if (cls === "bg-scroll") return `.${cls} { background-attachment: scroll; }`;
2921
- if (cls === "bg-origin-border") return `.${cls} { background-origin: border-box; }`;
2922
- if (cls === "bg-origin-padding") return `.${cls} { background-origin: padding-box; }`;
2923
- if (cls === "bg-origin-content") return `.${cls} { background-origin: content-box; }`;
2924
- if (cls === "bg-clip-border") return `.${cls} { background-clip: border-box; }`;
2925
- if (cls === "bg-clip-padding") return `.${cls} { background-clip: padding-box; }`;
2926
- if (cls === "bg-clip-content") return `.${cls} { background-clip: content-box; }`;
2927
- if (cls === "bg-clip-text") return `.${cls} { background-clip: text; -webkit-background-clip: text; }`;
2939
+ if (mixBlendMap[cls]) return `.${escapeSelector(cls)} { mix-blend-mode: ${mixBlendMap[cls]}; }`;
2940
+ if (cls === "bg-auto") return `.${escapeSelector(cls)} { background-size: auto; }`;
2941
+ if (cls === "bg-cover") return `.${escapeSelector(cls)} { background-size: cover; }`;
2942
+ if (cls === "bg-contain") return `.${escapeSelector(cls)} { background-size: contain; }`;
2943
+ if (cls === "bg-center") return `.${escapeSelector(cls)} { background-position: center; }`;
2944
+ if (cls === "bg-top") return `.${escapeSelector(cls)} { background-position: top; }`;
2945
+ if (cls === "bg-bottom") return `.${escapeSelector(cls)} { background-position: bottom; }`;
2946
+ if (cls === "bg-left") return `.${escapeSelector(cls)} { background-position: left; }`;
2947
+ if (cls === "bg-right") return `.${escapeSelector(cls)} { background-position: right; }`;
2948
+ if (cls === "bg-left-top") return `.${escapeSelector(cls)} { background-position: left top; }`;
2949
+ if (cls === "bg-left-bottom") return `.${escapeSelector(cls)} { background-position: left bottom; }`;
2950
+ if (cls === "bg-right-top") return `.${escapeSelector(cls)} { background-position: right top; }`;
2951
+ if (cls === "bg-right-bottom") return `.${escapeSelector(cls)} { background-position: right bottom; }`;
2952
+ if (cls === "bg-repeat") return `.${escapeSelector(cls)} { background-repeat: repeat; }`;
2953
+ if (cls === "bg-no-repeat") return `.${escapeSelector(cls)} { background-repeat: no-repeat; }`;
2954
+ if (cls === "bg-repeat-x") return `.${escapeSelector(cls)} { background-repeat: repeat-x; }`;
2955
+ if (cls === "bg-repeat-y") return `.${escapeSelector(cls)} { background-repeat: repeat-y; }`;
2956
+ if (cls === "bg-repeat-round") return `.${escapeSelector(cls)} { background-repeat: round; }`;
2957
+ if (cls === "bg-repeat-space") return `.${escapeSelector(cls)} { background-repeat: space; }`;
2958
+ if (cls === "bg-fixed") return `.${escapeSelector(cls)} { background-attachment: fixed; }`;
2959
+ if (cls === "bg-local") return `.${escapeSelector(cls)} { background-attachment: local; }`;
2960
+ if (cls === "bg-scroll") return `.${escapeSelector(cls)} { background-attachment: scroll; }`;
2961
+ if (cls === "bg-origin-border") return `.${escapeSelector(cls)} { background-origin: border-box; }`;
2962
+ if (cls === "bg-origin-padding") return `.${escapeSelector(cls)} { background-origin: padding-box; }`;
2963
+ if (cls === "bg-origin-content") return `.${escapeSelector(cls)} { background-origin: content-box; }`;
2964
+ if (cls === "bg-clip-border") return `.${escapeSelector(cls)} { background-clip: border-box; }`;
2965
+ if (cls === "bg-clip-padding") return `.${escapeSelector(cls)} { background-clip: padding-box; }`;
2966
+ if (cls === "bg-clip-content") return `.${escapeSelector(cls)} { background-clip: content-box; }`;
2967
+ if (cls === "bg-clip-text") return `.${escapeSelector(cls)} { background-clip: text; -webkit-background-clip: text; }`;
2928
2968
  return null;
2929
2969
  }
2930
2970
 
@@ -2973,25 +3013,25 @@ function matchSizing(cls, spacing) {
2973
3013
  const wMatch = cls.match(/^w-(.+)$/);
2974
3014
  if (wMatch) {
2975
3015
  const key = wMatch[1];
2976
- if (key === "auto") return `.${cls} { width: auto; }`;
2977
- if (key === "full") return `.${cls} { width: 100%; }`;
2978
- if (key === "screen") return `.${cls} { width: 100vw; }`;
2979
- if (key === "svw") return `.${cls} { width: 100svw; }`;
2980
- if (key === "min") return `.${cls} { width: min-content; }`;
2981
- if (key === "max") return `.${cls} { width: max-content; }`;
2982
- if (key === "fit") return `.${cls} { width: fit-content; }`;
2983
- if (has2(fractions, key)) return `.${cls} { width: ${fractions[key]}; }`;
2984
- if (has2(spacing, key)) return `.${cls} { width: ${spacing[key]}; }`;
3016
+ if (key === "auto") return `.${escapeSelector(cls)} { width: auto; }`;
3017
+ if (key === "full") return `.${escapeSelector(cls)} { width: 100%; }`;
3018
+ if (key === "screen") return `.${escapeSelector(cls)} { width: 100vw; }`;
3019
+ if (key === "svw") return `.${escapeSelector(cls)} { width: 100svw; }`;
3020
+ if (key === "min") return `.${escapeSelector(cls)} { width: min-content; }`;
3021
+ if (key === "max") return `.${escapeSelector(cls)} { width: max-content; }`;
3022
+ if (key === "fit") return `.${escapeSelector(cls)} { width: fit-content; }`;
3023
+ if (has2(fractions, key)) return `.${escapeSelector(cls)} { width: ${fractions[key]}; }`;
3024
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { width: ${spacing[key]}; }`;
2985
3025
  }
2986
3026
  const minWMatch = cls.match(/^min-w-(.+)$/);
2987
3027
  if (minWMatch) {
2988
3028
  const key = minWMatch[1];
2989
- if (key === "0") return `.${cls} { min-width: 0px; }`;
2990
- if (key === "full") return `.${cls} { min-width: 100%; }`;
2991
- if (key === "min") return `.${cls} { min-width: min-content; }`;
2992
- if (key === "max") return `.${cls} { min-width: max-content; }`;
2993
- if (key === "fit") return `.${cls} { min-width: fit-content; }`;
2994
- if (has2(spacing, key)) return `.${cls} { min-width: ${spacing[key]}; }`;
3029
+ if (key === "0") return `.${escapeSelector(cls)} { min-width: 0px; }`;
3030
+ if (key === "full") return `.${escapeSelector(cls)} { min-width: 100%; }`;
3031
+ if (key === "min") return `.${escapeSelector(cls)} { min-width: min-content; }`;
3032
+ if (key === "max") return `.${escapeSelector(cls)} { min-width: max-content; }`;
3033
+ if (key === "fit") return `.${escapeSelector(cls)} { min-width: fit-content; }`;
3034
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { min-width: ${spacing[key]}; }`;
2995
3035
  }
2996
3036
  const maxWMap = {
2997
3037
  none: "none",
@@ -3019,43 +3059,52 @@ function matchSizing(cls, spacing) {
3019
3059
  };
3020
3060
  const maxWMatch = cls.match(/^max-w-(.+)$/);
3021
3061
  if (maxWMatch && has2(maxWMap, maxWMatch[1])) {
3022
- return `.${cls} { max-width: ${maxWMap[maxWMatch[1]]}; }`;
3062
+ return `.${escapeSelector(cls)} { max-width: ${maxWMap[maxWMatch[1]]}; }`;
3023
3063
  }
3024
3064
  const hMatch = cls.match(/^h-(.+)$/);
3025
3065
  if (hMatch) {
3026
3066
  const key = hMatch[1];
3027
- if (key === "auto") return `.${cls} { height: auto; }`;
3028
- if (key === "full") return `.${cls} { height: 100%; }`;
3029
- if (key === "screen") return `.${cls} { height: 100vh; }`;
3030
- if (key === "svh") return `.${cls} { height: 100svh; }`;
3031
- if (key === "dvh") return `.${cls} { height: 100dvh; }`;
3032
- if (key === "min") return `.${cls} { height: min-content; }`;
3033
- if (key === "max") return `.${cls} { height: max-content; }`;
3034
- if (key === "fit") return `.${cls} { height: fit-content; }`;
3035
- if (has2(fractions, key)) return `.${cls} { height: ${fractions[key]}; }`;
3036
- if (has2(spacing, key)) return `.${cls} { height: ${spacing[key]}; }`;
3067
+ if (key === "auto") return `.${escapeSelector(cls)} { height: auto; }`;
3068
+ if (key === "full") return `.${escapeSelector(cls)} { height: 100%; }`;
3069
+ if (key === "screen") return `.${escapeSelector(cls)} { height: 100vh; }`;
3070
+ if (key === "svh") return `.${escapeSelector(cls)} { height: 100svh; }`;
3071
+ if (key === "dvh") return `.${escapeSelector(cls)} { height: 100dvh; }`;
3072
+ if (key === "min") return `.${escapeSelector(cls)} { height: min-content; }`;
3073
+ if (key === "max") return `.${escapeSelector(cls)} { height: max-content; }`;
3074
+ if (key === "fit") return `.${escapeSelector(cls)} { height: fit-content; }`;
3075
+ if (has2(fractions, key)) return `.${escapeSelector(cls)} { height: ${fractions[key]}; }`;
3076
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { height: ${spacing[key]}; }`;
3037
3077
  }
3038
3078
  const minHMatch = cls.match(/^min-h-(.+)$/);
3039
3079
  if (minHMatch) {
3040
3080
  const key = minHMatch[1];
3041
- if (key === "0") return `.${cls} { min-height: 0px; }`;
3042
- if (key === "full") return `.${cls} { min-height: 100%; }`;
3043
- if (key === "screen") return `.${cls} { min-height: 100vh; }`;
3044
- if (key === "svh") return `.${cls} { min-height: 100svh; }`;
3045
- if (key === "dvh") return `.${cls} { min-height: 100dvh; }`;
3046
- if (key === "fit") return `.${cls} { min-height: fit-content; }`;
3047
- if (has2(spacing, key)) return `.${cls} { min-height: ${spacing[key]}; }`;
3081
+ if (key === "0") return `.${escapeSelector(cls)} { min-height: 0px; }`;
3082
+ if (key === "full") return `.${escapeSelector(cls)} { min-height: 100%; }`;
3083
+ if (key === "screen") return `.${escapeSelector(cls)} { min-height: 100vh; }`;
3084
+ if (key === "svh") return `.${escapeSelector(cls)} { min-height: 100svh; }`;
3085
+ if (key === "dvh") return `.${escapeSelector(cls)} { min-height: 100dvh; }`;
3086
+ if (key === "fit") return `.${escapeSelector(cls)} { min-height: fit-content; }`;
3087
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { min-height: ${spacing[key]}; }`;
3048
3088
  }
3049
3089
  const maxHMatch = cls.match(/^max-h-(.+)$/);
3050
3090
  if (maxHMatch) {
3051
3091
  const key = maxHMatch[1];
3052
- if (key === "none") return `.${cls} { max-height: none; }`;
3053
- if (key === "full") return `.${cls} { max-height: 100%; }`;
3054
- if (key === "screen") return `.${cls} { max-height: 100vh; }`;
3055
- if (key === "svh") return `.${cls} { max-height: 100svh; }`;
3056
- if (key === "dvh") return `.${cls} { max-height: 100dvh; }`;
3057
- if (key === "fit") return `.${cls} { max-height: fit-content; }`;
3058
- if (has2(spacing, key)) return `.${cls} { max-height: ${spacing[key]}; }`;
3092
+ if (key === "none") return `.${escapeSelector(cls)} { max-height: none; }`;
3093
+ if (key === "full") return `.${escapeSelector(cls)} { max-height: 100%; }`;
3094
+ if (key === "screen") return `.${escapeSelector(cls)} { max-height: 100vh; }`;
3095
+ if (key === "svh") return `.${escapeSelector(cls)} { max-height: 100svh; }`;
3096
+ if (key === "dvh") return `.${escapeSelector(cls)} { max-height: 100dvh; }`;
3097
+ if (key === "fit") return `.${escapeSelector(cls)} { max-height: fit-content; }`;
3098
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { max-height: ${spacing[key]}; }`;
3099
+ }
3100
+ const basisMatch = cls.match(/^basis-(.+)$/);
3101
+ if (basisMatch) {
3102
+ const key = basisMatch[1];
3103
+ if (key === "auto") return `.${escapeSelector(cls)} { flex-basis: auto; }`;
3104
+ if (key === "full") return `.${escapeSelector(cls)} { flex-basis: 100%; }`;
3105
+ if (key === "0") return `.${escapeSelector(cls)} { flex-basis: 0px; }`;
3106
+ if (has2(fractions, key)) return `.${escapeSelector(cls)} { flex-basis: ${fractions[key]}; }`;
3107
+ if (has2(spacing, key)) return `.${escapeSelector(cls)} { flex-basis: ${spacing[key]}; }`;
3059
3108
  }
3060
3109
  return null;
3061
3110
  }
@@ -3076,7 +3125,7 @@ function generateEffects(classes, config) {
3076
3125
  function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3077
3126
  const opacityMatch = cls.match(/^opacity-(.+)$/);
3078
3127
  if (opacityMatch && has3(opacity, opacityMatch[1])) {
3079
- return `.${cls} {
3128
+ return `.${escapeSelector(cls)} {
3080
3129
  opacity: ${opacity[opacityMatch[1]]};
3081
3130
  transition-property: opacity;
3082
3131
  transition-duration: var(--alive-duration, 0ms);
@@ -3085,86 +3134,86 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3085
3134
  }
3086
3135
  const zMatch = cls.match(/^z-(.+)$/);
3087
3136
  if (zMatch && has3(zIndex, zMatch[1])) {
3088
- return `.${cls} { z-index: ${zIndex[zMatch[1]]}; }`;
3137
+ return `.${escapeSelector(cls)} { z-index: ${zIndex[zMatch[1]]}; }`;
3089
3138
  }
3090
3139
  const shadowMatch = cls.match(/^shadow(?:-(.+))?$/);
3091
3140
  if (shadowMatch) {
3092
3141
  const key = shadowMatch[1] ?? "DEFAULT";
3093
3142
  if (has3(boxShadow, key)) {
3094
- return `.${cls} { box-shadow: ${boxShadow[key]}; }`;
3143
+ return `.${escapeSelector(cls)} { box-shadow: ${boxShadow[key]}; }`;
3095
3144
  }
3096
3145
  if (!shadowMatch[1] && has3(boxShadow, "DEFAULT")) {
3097
- return `.${cls} { box-shadow: ${boxShadow["DEFAULT"]}; }`;
3146
+ return `.${escapeSelector(cls)} { box-shadow: ${boxShadow["DEFAULT"]}; }`;
3098
3147
  }
3099
3148
  }
3100
3149
  const roundedMatch = cls.match(/^rounded(?:-(.+))?$/);
3101
3150
  if (roundedMatch) {
3102
3151
  const key = roundedMatch[1] ?? "DEFAULT";
3103
- if (has3(borderRadius, key)) return `.${cls} { border-radius: ${borderRadius[key]}; }`;
3104
- if (!roundedMatch[1] && has3(borderRadius, "DEFAULT")) return `.${cls} { border-radius: ${borderRadius["DEFAULT"]}; }`;
3152
+ if (has3(borderRadius, key)) return `.${escapeSelector(cls)} { border-radius: ${borderRadius[key]}; }`;
3153
+ if (!roundedMatch[1] && has3(borderRadius, "DEFAULT")) return `.${escapeSelector(cls)} { border-radius: ${borderRadius["DEFAULT"]}; }`;
3105
3154
  }
3106
3155
  const roundedTMatch = cls.match(/^rounded-t(?:-(.+))?$/);
3107
3156
  if (roundedTMatch) {
3108
3157
  const rkey = roundedTMatch[1] ?? "DEFAULT";
3109
3158
  const val = has3(borderRadius, rkey) ? borderRadius[rkey] : has3(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3110
- if (val) return `.${cls} { border-top-left-radius: ${val}; border-top-right-radius: ${val}; }`;
3159
+ if (val) return `.${escapeSelector(cls)} { border-top-left-radius: ${val}; border-top-right-radius: ${val}; }`;
3111
3160
  }
3112
3161
  const roundedBMatch = cls.match(/^rounded-b(?:-(.+))?$/);
3113
3162
  if (roundedBMatch) {
3114
3163
  const rkey = roundedBMatch[1] ?? "DEFAULT";
3115
3164
  const val = has3(borderRadius, rkey) ? borderRadius[rkey] : has3(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3116
- if (val) return `.${cls} { border-bottom-left-radius: ${val}; border-bottom-right-radius: ${val}; }`;
3165
+ if (val) return `.${escapeSelector(cls)} { border-bottom-left-radius: ${val}; border-bottom-right-radius: ${val}; }`;
3117
3166
  }
3118
3167
  const roundedLMatch = cls.match(/^rounded-l(?:-(.+))?$/);
3119
3168
  if (roundedLMatch) {
3120
3169
  const rkey = roundedLMatch[1] ?? "DEFAULT";
3121
3170
  const val = has3(borderRadius, rkey) ? borderRadius[rkey] : has3(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3122
- if (val) return `.${cls} { border-top-left-radius: ${val}; border-bottom-left-radius: ${val}; }`;
3171
+ if (val) return `.${escapeSelector(cls)} { border-top-left-radius: ${val}; border-bottom-left-radius: ${val}; }`;
3123
3172
  }
3124
3173
  const roundedRMatch = cls.match(/^rounded-r(?:-(.+))?$/);
3125
3174
  if (roundedRMatch) {
3126
3175
  const rkey = roundedRMatch[1] ?? "DEFAULT";
3127
3176
  const val = has3(borderRadius, rkey) ? borderRadius[rkey] : has3(borderRadius, "DEFAULT") ? borderRadius["DEFAULT"] : null;
3128
- if (val) return `.${cls} { border-top-right-radius: ${val}; border-bottom-right-radius: ${val}; }`;
3129
- }
3130
- if (cls === "border") return `.${cls} { border-width: 1px; border-style: solid; }`;
3131
- if (cls === "border-0") return `.${cls} { border-width: 0px; }`;
3132
- if (cls === "border-2") return `.${cls} { border-width: 2px; border-style: solid; }`;
3133
- if (cls === "border-4") return `.${cls} { border-width: 4px; border-style: solid; }`;
3134
- if (cls === "border-8") return `.${cls} { border-width: 8px; border-style: solid; }`;
3135
- if (cls === "border-t") return `.${cls} { border-top-width: 1px; border-top-style: solid; }`;
3136
- if (cls === "border-r") return `.${cls} { border-right-width: 1px; border-right-style: solid; }`;
3137
- if (cls === "border-b") return `.${cls} { border-bottom-width: 1px; border-bottom-style: solid; }`;
3138
- if (cls === "border-l") return `.${cls} { border-left-width: 1px; border-left-style: solid; }`;
3139
- if (cls === "border-t-0") return `.${cls} { border-top-width: 0px; }`;
3140
- if (cls === "border-r-0") return `.${cls} { border-right-width: 0px; }`;
3141
- if (cls === "border-b-0") return `.${cls} { border-bottom-width: 0px; }`;
3142
- if (cls === "border-l-0") return `.${cls} { border-left-width: 0px; }`;
3143
- if (cls === "border-solid") return `.${cls} { border-style: solid; }`;
3144
- if (cls === "border-dashed") return `.${cls} { border-style: dashed; }`;
3145
- if (cls === "border-dotted") return `.${cls} { border-style: dotted; }`;
3146
- if (cls === "border-double") return `.${cls} { border-style: double; }`;
3147
- if (cls === "border-hidden") return `.${cls} { border-style: hidden; }`;
3148
- if (cls === "border-none") return `.${cls} { border-style: none; }`;
3149
- if (cls === "outline-none") return `.${cls} { outline: 2px solid transparent; outline-offset: 2px; }`;
3150
- if (cls === "outline") return `.${cls} { outline-style: solid; }`;
3151
- if (cls === "outline-dashed") return `.${cls} { outline-style: dashed; }`;
3152
- if (cls === "outline-dotted") return `.${cls} { outline-style: dotted; }`;
3153
- if (cls === "outline-double") return `.${cls} { outline-style: double; }`;
3177
+ if (val) return `.${escapeSelector(cls)} { border-top-right-radius: ${val}; border-bottom-right-radius: ${val}; }`;
3178
+ }
3179
+ if (cls === "border") return `.${escapeSelector(cls)} { border-width: 1px; border-style: solid; }`;
3180
+ if (cls === "border-0") return `.${escapeSelector(cls)} { border-width: 0px; }`;
3181
+ if (cls === "border-2") return `.${escapeSelector(cls)} { border-width: 2px; border-style: solid; }`;
3182
+ if (cls === "border-4") return `.${escapeSelector(cls)} { border-width: 4px; border-style: solid; }`;
3183
+ if (cls === "border-8") return `.${escapeSelector(cls)} { border-width: 8px; border-style: solid; }`;
3184
+ if (cls === "border-t") return `.${escapeSelector(cls)} { border-top-width: 1px; border-top-style: solid; }`;
3185
+ if (cls === "border-r") return `.${escapeSelector(cls)} { border-right-width: 1px; border-right-style: solid; }`;
3186
+ if (cls === "border-b") return `.${escapeSelector(cls)} { border-bottom-width: 1px; border-bottom-style: solid; }`;
3187
+ if (cls === "border-l") return `.${escapeSelector(cls)} { border-left-width: 1px; border-left-style: solid; }`;
3188
+ if (cls === "border-t-0") return `.${escapeSelector(cls)} { border-top-width: 0px; }`;
3189
+ if (cls === "border-r-0") return `.${escapeSelector(cls)} { border-right-width: 0px; }`;
3190
+ if (cls === "border-b-0") return `.${escapeSelector(cls)} { border-bottom-width: 0px; }`;
3191
+ if (cls === "border-l-0") return `.${escapeSelector(cls)} { border-left-width: 0px; }`;
3192
+ if (cls === "border-solid") return `.${escapeSelector(cls)} { border-style: solid; }`;
3193
+ if (cls === "border-dashed") return `.${escapeSelector(cls)} { border-style: dashed; }`;
3194
+ if (cls === "border-dotted") return `.${escapeSelector(cls)} { border-style: dotted; }`;
3195
+ if (cls === "border-double") return `.${escapeSelector(cls)} { border-style: double; }`;
3196
+ if (cls === "border-hidden") return `.${escapeSelector(cls)} { border-style: hidden; }`;
3197
+ if (cls === "border-none") return `.${escapeSelector(cls)} { border-style: none; }`;
3198
+ if (cls === "outline-none") return `.${escapeSelector(cls)} { outline: 2px solid transparent; outline-offset: 2px; }`;
3199
+ if (cls === "outline") return `.${escapeSelector(cls)} { outline-style: solid; }`;
3200
+ if (cls === "outline-dashed") return `.${escapeSelector(cls)} { outline-style: dashed; }`;
3201
+ if (cls === "outline-dotted") return `.${escapeSelector(cls)} { outline-style: dotted; }`;
3202
+ if (cls === "outline-double") return `.${escapeSelector(cls)} { outline-style: double; }`;
3154
3203
  const outlineWidthMatch = cls.match(/^outline-(\d+)$/);
3155
- if (outlineWidthMatch) return `.${cls} { outline-width: ${outlineWidthMatch[1]}px; }`;
3204
+ if (outlineWidthMatch) return `.${escapeSelector(cls)} { outline-width: ${outlineWidthMatch[1]}px; }`;
3156
3205
  const outlineOffsetMatch = cls.match(/^outline-offset-(\d+)$/);
3157
- if (outlineOffsetMatch) return `.${cls} { outline-offset: ${outlineOffsetMatch[1]}px; }`;
3206
+ if (outlineOffsetMatch) return `.${escapeSelector(cls)} { outline-offset: ${outlineOffsetMatch[1]}px; }`;
3158
3207
  const ringMatch = cls.match(/^ring(?:-(\d+))?$/);
3159
3208
  if (ringMatch) {
3160
3209
  const width = ringMatch[1] ?? "3";
3161
- return `.${cls} { box-shadow: 0 0 0 ${width}px var(--alive-ring-color, rgba(59, 130, 246, 0.5)); }`;
3210
+ return `.${escapeSelector(cls)} { box-shadow: 0 0 0 ${width}px var(--alive-ring-color, rgba(59, 130, 246, 0.5)); }`;
3162
3211
  }
3163
- if (cls === "ring-inset") return `.${cls} { --alive-ring-inset: inset; }`;
3212
+ if (cls === "ring-inset") return `.${escapeSelector(cls)} { --alive-ring-inset: inset; }`;
3164
3213
  const ringOffsetMatch = cls.match(/^ring-offset-(\d+)$/);
3165
- if (ringOffsetMatch) return `.${cls} { --alive-ring-offset: ${ringOffsetMatch[1]}px; }`;
3166
- 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)); }`;
3167
- if (cls === "transform-none") return `.${cls} { transform: none; }`;
3214
+ if (ringOffsetMatch) return `.${escapeSelector(cls)} { --alive-ring-offset: ${ringOffsetMatch[1]}px; }`;
3215
+ 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)); }`;
3216
+ if (cls === "transform-none") return `.${escapeSelector(cls)} { transform: none; }`;
3168
3217
  const scaleMap = {
3169
3218
  "0": "0",
3170
3219
  "50": ".5",
@@ -3179,15 +3228,15 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3179
3228
  };
3180
3229
  const scaleMatch = cls.match(/^scale-(\d+)$/);
3181
3230
  if (scaleMatch && has3(scaleMap, scaleMatch[1])) {
3182
- return `.${cls} { transform: scale(${scaleMap[scaleMatch[1]]}); }`;
3231
+ return `.${escapeSelector(cls)} { transform: scale(${scaleMap[scaleMatch[1]]}); }`;
3183
3232
  }
3184
3233
  const scaleXMatch = cls.match(/^scale-x-(\d+)$/);
3185
3234
  if (scaleXMatch && has3(scaleMap, scaleXMatch[1])) {
3186
- return `.${cls} { transform: scaleX(${scaleMap[scaleXMatch[1]]}); }`;
3235
+ return `.${escapeSelector(cls)} { transform: scaleX(${scaleMap[scaleXMatch[1]]}); }`;
3187
3236
  }
3188
3237
  const scaleYMatch = cls.match(/^scale-y-(\d+)$/);
3189
3238
  if (scaleYMatch && has3(scaleMap, scaleYMatch[1])) {
3190
- return `.${cls} { transform: scaleY(${scaleMap[scaleYMatch[1]]}); }`;
3239
+ return `.${escapeSelector(cls)} { transform: scaleY(${scaleMap[scaleYMatch[1]]}); }`;
3191
3240
  }
3192
3241
  const rotateMatch = cls.match(/^-?rotate-(\d+)$/);
3193
3242
  if (rotateMatch) {
@@ -3210,12 +3259,12 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3210
3259
  const val = fractions[key] ?? null;
3211
3260
  if (val) return `.${cls.replace(/^-/, "\\-")} { transform: translateY(${neg}${val}); }`;
3212
3261
  }
3213
- if (cls === "transition-none") return `.${cls} { transition: none; }`;
3214
- if (cls === "transition-all") return `.${cls} { transition: all var(--alive-duration-normal) var(--alive-ease-standard); }`;
3215
- 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); }`;
3216
- if (cls === "transition-opacity") return `.${cls} { transition: opacity; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3217
- if (cls === "transition-shadow") return `.${cls} { transition: box-shadow; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3218
- if (cls === "transition-transform") return `.${cls} { transition: transform; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3262
+ if (cls === "transition-none") return `.${escapeSelector(cls)} { transition: none; }`;
3263
+ if (cls === "transition-all") return `.${escapeSelector(cls)} { transition: all var(--alive-duration-normal) var(--alive-ease-standard); }`;
3264
+ 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); }`;
3265
+ if (cls === "transition-opacity") return `.${escapeSelector(cls)} { transition: opacity; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3266
+ if (cls === "transition-shadow") return `.${escapeSelector(cls)} { transition: box-shadow; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3267
+ if (cls === "transition-transform") return `.${escapeSelector(cls)} { transition: transform; transition-duration: var(--alive-duration-normal); transition-timing-function: var(--alive-ease-standard); }`;
3219
3268
  const blurMatch = cls.match(/^blur(?:-(.+))?$/);
3220
3269
  if (blurMatch) {
3221
3270
  const blurMap = {
@@ -3229,7 +3278,7 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3229
3278
  "3xl": "64px"
3230
3279
  };
3231
3280
  const key = blurMatch[1] ?? "DEFAULT";
3232
- if (has3(blurMap, key)) return `.${cls} { filter: blur(${blurMap[key]}); }`;
3281
+ if (has3(blurMap, key)) return `.${escapeSelector(cls)} { filter: blur(${blurMap[key]}); }`;
3233
3282
  }
3234
3283
  const backdropBlurMatch = cls.match(/^backdrop-blur(?:-(.+))?$/);
3235
3284
  if (backdropBlurMatch) {
@@ -3244,7 +3293,7 @@ function matchEffects(cls, opacity, zIndex, boxShadow, borderRadius) {
3244
3293
  "3xl": "64px"
3245
3294
  };
3246
3295
  const key = backdropBlurMatch[1] ?? "DEFAULT";
3247
- if (has3(blurMap, key)) return `.${cls} { backdrop-filter: blur(${blurMap[key]}); }`;
3296
+ if (has3(blurMap, key)) return `.${escapeSelector(cls)} { backdrop-filter: blur(${blurMap[key]}); }`;
3248
3297
  }
3249
3298
  const arbOpacityMatch = cls.match(/^opacity-\[(.+)\]$/);
3250
3299
  if (arbOpacityMatch) {
@@ -3373,6 +3422,9 @@ function generateUtilities(classes, config) {
3373
3422
  case "placeholder":
3374
3423
  selector += "::placeholder";
3375
3424
  break;
3425
+ case "file":
3426
+ selector += "::file-selector-button";
3427
+ break;
3376
3428
  case "group-hover":
3377
3429
  selector = `.group:hover ${selector}`;
3378
3430
  break;
@@ -3467,275 +3519,275 @@ function generateAliveSpecific(classes, _config) {
3467
3519
  ];
3468
3520
  if (aliveBasePrefixes.some((p) => cls === p || cls.startsWith(p + "-"))) continue;
3469
3521
  if (cls === "animate-none") {
3470
- rules.push(`.${cls} { animation: none; }`);
3522
+ rules.push(`.${escapeSelector(cls)} { animation: none; }`);
3471
3523
  continue;
3472
3524
  }
3473
3525
  if (cls === "animate-spin") {
3474
- rules.push(`.${cls} { animation: alive-spin 1s linear infinite; }`);
3526
+ rules.push(`.${escapeSelector(cls)} { animation: alive-spin 1s linear infinite; }`);
3475
3527
  continue;
3476
3528
  }
3477
3529
  if (cls === "animate-ping") {
3478
- rules.push(`.${cls} { animation: alive-ping 1s cubic-bezier(0,0,0.2,1) infinite; }`);
3530
+ rules.push(`.${escapeSelector(cls)} { animation: alive-ping 1s cubic-bezier(0,0,0.2,1) infinite; }`);
3479
3531
  continue;
3480
3532
  }
3481
3533
  if (cls === "animate-pulse") {
3482
- rules.push(`.${cls} { animation: alive-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }`);
3534
+ rules.push(`.${escapeSelector(cls)} { animation: alive-pulse 2s cubic-bezier(0.4,0,0.6,1) infinite; }`);
3483
3535
  continue;
3484
3536
  }
3485
3537
  if (cls === "animate-bounce") {
3486
- rules.push(`.${cls} { animation: alive-bounce 1s infinite; }`);
3538
+ rules.push(`.${escapeSelector(cls)} { animation: alive-bounce 1s infinite; }`);
3487
3539
  continue;
3488
3540
  }
3489
3541
  if (cls === "animate-shimmer") {
3490
- rules.push(`.${cls} { animation: alive-shimmer 1.5s linear infinite; }`);
3542
+ rules.push(`.${escapeSelector(cls)} { animation: alive-shimmer 1.5s linear infinite; }`);
3491
3543
  continue;
3492
3544
  }
3493
3545
  if (cls === "ease-linear") {
3494
- rules.push(`.${cls} { transition-timing-function: linear; }`);
3546
+ rules.push(`.${escapeSelector(cls)} { transition-timing-function: linear; }`);
3495
3547
  continue;
3496
3548
  }
3497
3549
  if (cls === "ease-in") {
3498
- rules.push(`.${cls} { transition-timing-function: cubic-bezier(0.4,0,1,1); }`);
3550
+ rules.push(`.${escapeSelector(cls)} { transition-timing-function: cubic-bezier(0.4,0,1,1); }`);
3499
3551
  continue;
3500
3552
  }
3501
3553
  if (cls === "ease-out") {
3502
- rules.push(`.${cls} { transition-timing-function: cubic-bezier(0,0,0.2,1); }`);
3554
+ rules.push(`.${escapeSelector(cls)} { transition-timing-function: cubic-bezier(0,0,0.2,1); }`);
3503
3555
  continue;
3504
3556
  }
3505
3557
  if (cls === "ease-in-out") {
3506
- rules.push(`.${cls} { transition-timing-function: cubic-bezier(0.4,0,0.2,1); }`);
3558
+ rules.push(`.${escapeSelector(cls)} { transition-timing-function: cubic-bezier(0.4,0,0.2,1); }`);
3507
3559
  continue;
3508
3560
  }
3509
3561
  if (cls === "group") {
3510
- rules.push(`.${cls} {}`);
3562
+ rules.push(`.${escapeSelector(cls)} {}`);
3511
3563
  continue;
3512
3564
  }
3513
3565
  const staggerMatch = cls.match(/^stagger-(\d+)$/);
3514
3566
  if (staggerMatch) {
3515
- rules.push(`.${cls} { --alive-stagger-gap: ${staggerMatch[1]}ms; }`);
3567
+ rules.push(`.${escapeSelector(cls)} { --alive-stagger-gap: ${staggerMatch[1]}ms; }`);
3516
3568
  continue;
3517
3569
  }
3518
3570
  const indexMatch = cls.match(/^alive-index-(\d+)$/);
3519
3571
  if (indexMatch) {
3520
- rules.push(`.${cls} { --alive-index: ${indexMatch[1]}; }`);
3572
+ rules.push(`.${escapeSelector(cls)} { --alive-index: ${indexMatch[1]}; }`);
3521
3573
  continue;
3522
3574
  }
3523
3575
  const durationMatch = cls.match(/^duration-(\d+)$/);
3524
3576
  if (durationMatch) {
3525
- rules.push(`.${cls} { --alive-duration: ${durationMatch[1]}ms; }`);
3577
+ rules.push(`.${escapeSelector(cls)} { --alive-duration: ${durationMatch[1]}ms; }`);
3526
3578
  continue;
3527
3579
  }
3528
3580
  const delayMatch = cls.match(/^delay-(\d+)$/);
3529
3581
  if (delayMatch) {
3530
- rules.push(`.${cls} { animation-delay: ${delayMatch[1]}ms; }`);
3582
+ rules.push(`.${escapeSelector(cls)} { animation-delay: ${delayMatch[1]}ms; }`);
3531
3583
  continue;
3532
3584
  }
3533
3585
  const motionMsMatch = cls.match(/^motion-(\d+)$/);
3534
3586
  if (motionMsMatch) {
3535
- rules.push(`.${cls} { --alive-duration: ${motionMsMatch[1]}ms !important; }`);
3587
+ rules.push(`.${escapeSelector(cls)} { --alive-duration: ${motionMsMatch[1]}ms !important; }`);
3536
3588
  continue;
3537
3589
  }
3538
3590
  if (cls === "divide-x") {
3539
- rules.push(`.${cls} > * + * { border-left-width: 1px; border-left-style: solid; }`);
3591
+ rules.push(`.${escapeSelector(cls)}> * + * { border-left-width: 1px; border-left-style: solid; }`);
3540
3592
  continue;
3541
3593
  }
3542
3594
  if (cls === "divide-y") {
3543
- rules.push(`.${cls} > * + * { border-top-width: 1px; border-top-style: solid; }`);
3595
+ rules.push(`.${escapeSelector(cls)}> * + * { border-top-width: 1px; border-top-style: solid; }`);
3544
3596
  continue;
3545
3597
  }
3546
3598
  const divideColorMatch = cls.match(/^divide-([a-z]+)(?:-(\d+))?$/);
3547
3599
  if (divideColorMatch) {
3548
- rules.push(`.${cls} > * + * { border-color: inherit; }`);
3600
+ rules.push(`.${escapeSelector(cls)}> * + * { border-color: inherit; }`);
3549
3601
  continue;
3550
3602
  }
3551
3603
  if (cls === "appearance-none") {
3552
- rules.push(`.${cls} { appearance: none; }`);
3604
+ rules.push(`.${escapeSelector(cls)} { appearance: none; }`);
3553
3605
  continue;
3554
3606
  }
3555
3607
  if (cls === "appearance-auto") {
3556
- rules.push(`.${cls} { appearance: auto; }`);
3608
+ rules.push(`.${escapeSelector(cls)} { appearance: auto; }`);
3557
3609
  continue;
3558
3610
  }
3559
3611
  if (cls === "resize-none") {
3560
- rules.push(`.${cls} { resize: none; }`);
3612
+ rules.push(`.${escapeSelector(cls)} { resize: none; }`);
3561
3613
  continue;
3562
3614
  }
3563
3615
  if (cls === "resize") {
3564
- rules.push(`.${cls} { resize: both; }`);
3616
+ rules.push(`.${escapeSelector(cls)} { resize: both; }`);
3565
3617
  continue;
3566
3618
  }
3567
3619
  if (cls === "resize-y") {
3568
- rules.push(`.${cls} { resize: vertical; }`);
3620
+ rules.push(`.${escapeSelector(cls)} { resize: vertical; }`);
3569
3621
  continue;
3570
3622
  }
3571
3623
  if (cls === "resize-x") {
3572
- rules.push(`.${cls} { resize: horizontal; }`);
3624
+ rules.push(`.${escapeSelector(cls)} { resize: horizontal; }`);
3573
3625
  continue;
3574
3626
  }
3575
3627
  if (cls === "snap-none") {
3576
- rules.push(`.${cls} { scroll-snap-type: none; }`);
3628
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-type: none; }`);
3577
3629
  continue;
3578
3630
  }
3579
3631
  if (cls === "snap-x") {
3580
- rules.push(`.${cls} { scroll-snap-type: x mandatory; }`);
3632
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-type: x mandatory; }`);
3581
3633
  continue;
3582
3634
  }
3583
3635
  if (cls === "snap-y") {
3584
- rules.push(`.${cls} { scroll-snap-type: y mandatory; }`);
3636
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-type: y mandatory; }`);
3585
3637
  continue;
3586
3638
  }
3587
3639
  if (cls === "snap-start") {
3588
- rules.push(`.${cls} { scroll-snap-align: start; }`);
3640
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-align: start; }`);
3589
3641
  continue;
3590
3642
  }
3591
3643
  if (cls === "snap-center") {
3592
- rules.push(`.${cls} { scroll-snap-align: center; }`);
3644
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-align: center; }`);
3593
3645
  continue;
3594
3646
  }
3595
3647
  if (cls === "snap-end") {
3596
- rules.push(`.${cls} { scroll-snap-align: end; }`);
3648
+ rules.push(`.${escapeSelector(cls)} { scroll-snap-align: end; }`);
3597
3649
  continue;
3598
3650
  }
3599
3651
  if (cls === "pointer-events-none") {
3600
- rules.push(`.${cls} { pointer-events: none; }`);
3652
+ rules.push(`.${escapeSelector(cls)} { pointer-events: none; }`);
3601
3653
  continue;
3602
3654
  }
3603
3655
  if (cls === "pointer-events-auto") {
3604
- rules.push(`.${cls} { pointer-events: auto; }`);
3656
+ rules.push(`.${escapeSelector(cls)} { pointer-events: auto; }`);
3605
3657
  continue;
3606
3658
  }
3607
3659
  if (cls === "sr-only") {
3608
- 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; }`);
3660
+ 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; }`);
3609
3661
  continue;
3610
3662
  }
3611
3663
  if (cls === "not-sr-only") {
3612
- rules.push(`.${cls} { position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; white-space: normal; }`);
3664
+ rules.push(`.${escapeSelector(cls)} { position: static; width: auto; height: auto; padding: 0; margin: 0; overflow: visible; clip: auto; white-space: normal; }`);
3613
3665
  continue;
3614
3666
  }
3615
3667
  if (cls === "will-change-auto") {
3616
- rules.push(`.${cls} { will-change: auto; }`);
3668
+ rules.push(`.${escapeSelector(cls)} { will-change: auto; }`);
3617
3669
  continue;
3618
3670
  }
3619
3671
  if (cls === "will-change-transform") {
3620
- rules.push(`.${cls} { will-change: transform; }`);
3672
+ rules.push(`.${escapeSelector(cls)} { will-change: transform; }`);
3621
3673
  continue;
3622
3674
  }
3623
3675
  if (cls === "will-change-opacity") {
3624
- rules.push(`.${cls} { will-change: opacity; }`);
3676
+ rules.push(`.${escapeSelector(cls)} { will-change: opacity; }`);
3625
3677
  continue;
3626
3678
  }
3627
3679
  const lineClampMatch = cls.match(/^line-clamp-(\d+)$/);
3628
3680
  if (lineClampMatch) {
3629
3681
  const n = lineClampMatch[1];
3630
- rules.push(`.${cls} { overflow: hidden; display: -webkit-box; -webkit-line-clamp: ${n}; -webkit-box-orient: vertical; }`);
3682
+ rules.push(`.${escapeSelector(cls)} { overflow: hidden; display: -webkit-box; -webkit-line-clamp: ${n}; -webkit-box-orient: vertical; }`);
3631
3683
  continue;
3632
3684
  }
3633
3685
  if (cls === "aspect-square") {
3634
- rules.push(`.${cls} { aspect-ratio: 1 / 1; }`);
3686
+ rules.push(`.${escapeSelector(cls)} { aspect-ratio: 1 / 1; }`);
3635
3687
  continue;
3636
3688
  }
3637
3689
  if (cls === "aspect-video") {
3638
- rules.push(`.${cls} { aspect-ratio: 16 / 9; }`);
3690
+ rules.push(`.${escapeSelector(cls)} { aspect-ratio: 16 / 9; }`);
3639
3691
  continue;
3640
3692
  }
3641
3693
  if (cls === "aspect-auto") {
3642
- rules.push(`.${cls} { aspect-ratio: auto; }`);
3694
+ rules.push(`.${escapeSelector(cls)} { aspect-ratio: auto; }`);
3643
3695
  continue;
3644
3696
  }
3645
3697
  if (cls === "object-contain") {
3646
- rules.push(`.${cls} { object-fit: contain; }`);
3698
+ rules.push(`.${escapeSelector(cls)} { object-fit: contain; }`);
3647
3699
  continue;
3648
3700
  }
3649
3701
  if (cls === "object-cover") {
3650
- rules.push(`.${cls} { object-fit: cover; }`);
3702
+ rules.push(`.${escapeSelector(cls)} { object-fit: cover; }`);
3651
3703
  continue;
3652
3704
  }
3653
3705
  if (cls === "object-fill") {
3654
- rules.push(`.${cls} { object-fit: fill; }`);
3706
+ rules.push(`.${escapeSelector(cls)} { object-fit: fill; }`);
3655
3707
  continue;
3656
3708
  }
3657
3709
  if (cls === "object-none") {
3658
- rules.push(`.${cls} { object-fit: none; }`);
3710
+ rules.push(`.${escapeSelector(cls)} { object-fit: none; }`);
3659
3711
  continue;
3660
3712
  }
3661
3713
  if (cls === "object-scale") {
3662
- rules.push(`.${cls} { object-fit: scale-down; }`);
3714
+ rules.push(`.${escapeSelector(cls)} { object-fit: scale-down; }`);
3663
3715
  continue;
3664
3716
  }
3665
3717
  if (cls === "mix-blend-multiply") {
3666
- rules.push(`.${cls} { mix-blend-mode: multiply; }`);
3718
+ rules.push(`.${escapeSelector(cls)} { mix-blend-mode: multiply; }`);
3667
3719
  continue;
3668
3720
  }
3669
3721
  if (cls === "mix-blend-screen") {
3670
- rules.push(`.${cls} { mix-blend-mode: screen; }`);
3722
+ rules.push(`.${escapeSelector(cls)} { mix-blend-mode: screen; }`);
3671
3723
  continue;
3672
3724
  }
3673
3725
  if (cls === "mix-blend-overlay") {
3674
- rules.push(`.${cls} { mix-blend-mode: overlay; }`);
3726
+ rules.push(`.${escapeSelector(cls)} { mix-blend-mode: overlay; }`);
3675
3727
  continue;
3676
3728
  }
3677
3729
  if (cls === "mix-blend-normal") {
3678
- rules.push(`.${cls} { mix-blend-mode: normal; }`);
3730
+ rules.push(`.${escapeSelector(cls)} { mix-blend-mode: normal; }`);
3679
3731
  continue;
3680
3732
  }
3681
3733
  if (cls === "isolate") {
3682
- rules.push(`.${cls} { isolation: isolate; }`);
3734
+ rules.push(`.${escapeSelector(cls)} { isolation: isolate; }`);
3683
3735
  continue;
3684
3736
  }
3685
3737
  if (cls === "isolation-auto") {
3686
- rules.push(`.${cls} { isolation: auto; }`);
3738
+ rules.push(`.${escapeSelector(cls)} { isolation: auto; }`);
3687
3739
  continue;
3688
3740
  }
3689
3741
  if (cls === "touch-auto") {
3690
- rules.push(`.${cls} { touch-action: auto; }`);
3742
+ rules.push(`.${escapeSelector(cls)} { touch-action: auto; }`);
3691
3743
  continue;
3692
3744
  }
3693
3745
  if (cls === "touch-none") {
3694
- rules.push(`.${cls} { touch-action: none; }`);
3746
+ rules.push(`.${escapeSelector(cls)} { touch-action: none; }`);
3695
3747
  continue;
3696
3748
  }
3697
3749
  if (cls === "touch-pan-x") {
3698
- rules.push(`.${cls} { touch-action: pan-x; }`);
3750
+ rules.push(`.${escapeSelector(cls)} { touch-action: pan-x; }`);
3699
3751
  continue;
3700
3752
  }
3701
3753
  if (cls === "touch-pan-y") {
3702
- rules.push(`.${cls} { touch-action: pan-y; }`);
3754
+ rules.push(`.${escapeSelector(cls)} { touch-action: pan-y; }`);
3703
3755
  continue;
3704
3756
  }
3705
3757
  if (cls === "touch-manipulation") {
3706
- rules.push(`.${cls} { touch-action: manipulation; }`);
3758
+ rules.push(`.${escapeSelector(cls)} { touch-action: manipulation; }`);
3707
3759
  continue;
3708
3760
  }
3709
3761
  if (cls === "select-none") {
3710
- rules.push(`.${cls} { user-select: none; }`);
3762
+ rules.push(`.${escapeSelector(cls)} { user-select: none; }`);
3711
3763
  continue;
3712
3764
  }
3713
3765
  if (cls === "select-text") {
3714
- rules.push(`.${cls} { user-select: text; }`);
3766
+ rules.push(`.${escapeSelector(cls)} { user-select: text; }`);
3715
3767
  continue;
3716
3768
  }
3717
3769
  if (cls === "select-all") {
3718
- rules.push(`.${cls} { user-select: all; }`);
3770
+ rules.push(`.${escapeSelector(cls)} { user-select: all; }`);
3719
3771
  continue;
3720
3772
  }
3721
3773
  if (cls === "select-auto") {
3722
- rules.push(`.${cls} { user-select: auto; }`);
3774
+ rules.push(`.${escapeSelector(cls)} { user-select: auto; }`);
3723
3775
  continue;
3724
3776
  }
3725
3777
  if (cls === "break-normal") {
3726
- rules.push(`.${cls} { overflow-wrap: normal; word-break: normal; }`);
3778
+ rules.push(`.${escapeSelector(cls)} { overflow-wrap: normal; word-break: normal; }`);
3727
3779
  continue;
3728
3780
  }
3729
3781
  if (cls === "break-words") {
3730
- rules.push(`.${cls} { overflow-wrap: break-word; }`);
3782
+ rules.push(`.${escapeSelector(cls)} { overflow-wrap: break-word; }`);
3731
3783
  continue;
3732
3784
  }
3733
3785
  if (cls === "break-all") {
3734
- rules.push(`.${cls} { word-break: break-all; }`);
3786
+ rules.push(`.${escapeSelector(cls)} { word-break: break-all; }`);
3735
3787
  continue;
3736
3788
  }
3737
3789
  if (cls === "break-keep") {
3738
- rules.push(`.${cls} { word-break: keep-all; }`);
3790
+ rules.push(`.${escapeSelector(cls)} { word-break: keep-all; }`);
3739
3791
  continue;
3740
3792
  }
3741
3793
  }