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