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