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