@barocss/kit 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +411 -248
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +411 -248
- package/dist/index.js.map +1 -1
- package/dist/theme/default.cjs +88 -14
- package/dist/theme/default.cjs.map +1 -1
- package/dist/theme/default.js +88 -14
- package/dist/theme/default.js.map +1 -1
- package/package.json +4 -3
package/dist/index.cjs
CHANGED
|
@@ -251,6 +251,7 @@ function getUtility(ctx) {
|
|
|
251
251
|
const modifierRegistry = [];
|
|
252
252
|
function staticModifier(name, selectors, options = {}, ctx) {
|
|
253
253
|
registerModifier({
|
|
254
|
+
name,
|
|
254
255
|
match: (mod) => mod === name,
|
|
255
256
|
modifySelector: ({ ..._rest }) => {
|
|
256
257
|
return selectors.map((sel) => ({
|
|
@@ -1217,6 +1218,8 @@ function themeToCssVarsAll(theme) {
|
|
|
1217
1218
|
...transitionDurationToCssVars(theme.transitionDuration),
|
|
1218
1219
|
...transitionDelayToCssVars(theme.transitionDelay),
|
|
1219
1220
|
...blurToCssVars(theme.blur),
|
|
1221
|
+
...Object.fromEntries(Object.entries(theme.textShadow ?? {}).map(([k, v2]) => [`--text-shadow-${escapeKey(k)}`, v2])),
|
|
1222
|
+
...Object.fromEntries(Object.entries(theme.dropShadow ?? {}).map(([k, v2]) => [`--drop-shadow-${escapeKey(k)}`, v2])),
|
|
1220
1223
|
...Object.fromEntries(Object.entries(theme.aspect ?? {}).map(([k, v2]) => [`--aspect-${escapeKey(k)}`, v2]))
|
|
1221
1224
|
// keyframes handled separately
|
|
1222
1225
|
};
|
|
@@ -2108,7 +2111,7 @@ html {
|
|
|
2108
2111
|
line-height: 1.15;
|
|
2109
2112
|
-webkit-text-size-adjust: 100%;
|
|
2110
2113
|
/* Tailwind 4.1.13 root font (app --default-font-family / --font-sans win) */
|
|
2111
|
-
font-family: var(--default-font-family, var(--font-sans,
|
|
2114
|
+
font-family: var(--default-font-family, var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'));
|
|
2112
2115
|
font-feature-settings: var(--default-font-feature-settings, normal);
|
|
2113
2116
|
font-variation-settings: var(--default-font-variation-settings, normal);
|
|
2114
2117
|
}
|
|
@@ -2411,7 +2414,7 @@ html {
|
|
|
2411
2414
|
-webkit-text-size-adjust: 100%;
|
|
2412
2415
|
-ms-text-size-adjust: 100%;
|
|
2413
2416
|
/* Tailwind 4.1.13 root font (app --default-font-family / --font-sans win) */
|
|
2414
|
-
font-family: var(--default-font-family, var(--font-sans,
|
|
2417
|
+
font-family: var(--default-font-family, var(--font-sans, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'));
|
|
2415
2418
|
font-feature-settings: var(--default-font-feature-settings, normal);
|
|
2416
2419
|
font-variation-settings: var(--default-font-variation-settings, normal);
|
|
2417
2420
|
}
|
|
@@ -3490,6 +3493,9 @@ staticUtility("snap-both", [["scroll-snap-type", "both var(--baro-scroll-snap-st
|
|
|
3490
3493
|
staticUtility("snap-mandatory", [["--baro-scroll-snap-strictness", "mandatory"]], { category: "interactivity" });
|
|
3491
3494
|
staticUtility("snap-proximity", [["--baro-scroll-snap-strictness", "proximity"]], { category: "interactivity" });
|
|
3492
3495
|
[
|
|
3496
|
+
["mbs", "scroll-margin-block-start"],
|
|
3497
|
+
// #311 (Tailwind 4.3), before `mb`
|
|
3498
|
+
["mbe", "scroll-margin-block-end"],
|
|
3493
3499
|
["mt", "scroll-margin-top"],
|
|
3494
3500
|
["mr", "scroll-margin-right"],
|
|
3495
3501
|
["mb", "scroll-margin-bottom"],
|
|
@@ -3500,6 +3506,8 @@ staticUtility("snap-proximity", [["--baro-scroll-snap-strictness", "proximity"]]
|
|
|
3500
3506
|
["me", "scroll-margin-inline-end"],
|
|
3501
3507
|
["m", "scroll-margin"]
|
|
3502
3508
|
].forEach(([name, prop]) => {
|
|
3509
|
+
staticUtility(`scroll-${name}-px`, [[prop, "1px"]], { category: "interactivity" });
|
|
3510
|
+
staticUtility(`-scroll-${name}-px`, [[prop, "-1px"]], { category: "interactivity" });
|
|
3503
3511
|
functionalUtility({
|
|
3504
3512
|
name: `scroll-${name}`,
|
|
3505
3513
|
spacingKeys: true,
|
|
@@ -3518,6 +3526,9 @@ staticUtility("snap-proximity", [["--baro-scroll-snap-strictness", "proximity"]]
|
|
|
3518
3526
|
});
|
|
3519
3527
|
});
|
|
3520
3528
|
[
|
|
3529
|
+
["pbs", "scroll-padding-block-start"],
|
|
3530
|
+
// #311 (Tailwind 4.3), before `pb`
|
|
3531
|
+
["pbe", "scroll-padding-block-end"],
|
|
3521
3532
|
["pt", "scroll-padding-top"],
|
|
3522
3533
|
["pr", "scroll-padding-right"],
|
|
3523
3534
|
["pb", "scroll-padding-bottom"],
|
|
@@ -3534,13 +3545,15 @@ staticUtility("snap-proximity", [["--baro-scroll-snap-strictness", "proximity"]]
|
|
|
3534
3545
|
prop,
|
|
3535
3546
|
supportsArbitrary: true,
|
|
3536
3547
|
supportsCustomProperty: true,
|
|
3548
|
+
handleBareValue: ({ value }) => value === "px" ? "1px" : /^(\d|\.\d)/.test(value) ? value : null,
|
|
3537
3549
|
handle: (value, _ctx, token, _extra) => {
|
|
3538
|
-
if (
|
|
3550
|
+
if (token.negative) return [];
|
|
3551
|
+
if (parseNumber(value)) {
|
|
3539
3552
|
return [decl(prop, `calc(var(--spacing) * ${value})`)];
|
|
3540
3553
|
}
|
|
3541
3554
|
return [decl(prop, value)];
|
|
3542
3555
|
},
|
|
3543
|
-
handleCustomProperty: (value) => [decl(prop, `var(${value})`)],
|
|
3556
|
+
handleCustomProperty: (value, _ctx, token) => token.negative ? [] : [decl(prop, `var(${value})`)],
|
|
3544
3557
|
description: `scroll-${name} utility (static, arbitrary, custom property supported)`,
|
|
3545
3558
|
category: "interactivity"
|
|
3546
3559
|
});
|
|
@@ -3571,6 +3584,40 @@ functionalUtility({
|
|
|
3571
3584
|
description: "will-change utility (static, arbitrary, custom property supported)",
|
|
3572
3585
|
category: "interactivity"
|
|
3573
3586
|
});
|
|
3587
|
+
staticUtility("scrollbar-auto", [["scrollbar-width", "auto"]], { category: "interactivity" });
|
|
3588
|
+
staticUtility("scrollbar-thin", [["scrollbar-width", "thin"]], { category: "interactivity" });
|
|
3589
|
+
staticUtility("scrollbar-none", [["scrollbar-width", "none"]], { category: "interactivity" });
|
|
3590
|
+
staticUtility("scrollbar-gutter-auto", [["scrollbar-gutter", "auto"]], { category: "interactivity" });
|
|
3591
|
+
staticUtility("scrollbar-gutter-stable", [["scrollbar-gutter", "stable"]], { category: "interactivity" });
|
|
3592
|
+
staticUtility("scrollbar-gutter-both", [["scrollbar-gutter", "stable both-edges"]], { category: "interactivity" });
|
|
3593
|
+
const SCROLLBAR_COLOR = "var(--baro-scrollbar-thumb) var(--baro-scrollbar-track)";
|
|
3594
|
+
const scrollbarProperties = () => atRoot([
|
|
3595
|
+
property("--baro-scrollbar-thumb", "#0000", "<color>"),
|
|
3596
|
+
property("--baro-scrollbar-track", "#0000", "<color>")
|
|
3597
|
+
]);
|
|
3598
|
+
const stripColorHint = (v) => v.replace(/^color:/, "");
|
|
3599
|
+
for (const part of ["thumb", "track"]) {
|
|
3600
|
+
const key = `--baro-scrollbar-${part}`;
|
|
3601
|
+
const compose = (inner) => [scrollbarProperties(), ...inner, decl("scrollbar-color", SCROLLBAR_COLOR)];
|
|
3602
|
+
const withOpacity = (color, opacity) => opacity ? [decl(key, `color-mix(in oklab, ${color} ${opacity.replace(/^\[(.*)\]$/, "$1").replace(/%$/, "")}%, transparent)`)] : [decl(key, color)];
|
|
3603
|
+
functionalUtility({
|
|
3604
|
+
name: `scrollbar-${part}`,
|
|
3605
|
+
themeKeys: ["colors"],
|
|
3606
|
+
supportsOpacity: true,
|
|
3607
|
+
supportsArbitrary: true,
|
|
3608
|
+
supportsCustomProperty: true,
|
|
3609
|
+
handle: (value, _ctx, token, extra) => {
|
|
3610
|
+
if (extra?.realThemeValue) return compose(withOpacity(`var(--color-${extra.realThemeValue})`, extra.opacity));
|
|
3611
|
+
if (token.arbitrary) return compose(withOpacity(stripColorHint(value), extra?.opacity));
|
|
3612
|
+
if (value === "inherit" || value === "transparent") return compose([decl(key, value)]);
|
|
3613
|
+
if (value === "current") return compose(withOpacity("currentcolor", extra?.opacity));
|
|
3614
|
+
return null;
|
|
3615
|
+
},
|
|
3616
|
+
handleCustomProperty: (value, _ctx, _token, extra) => compose(withOpacity(`var(${stripColorHint(value)})`, extra?.opacity)),
|
|
3617
|
+
description: `scrollbar-color ${part} utility (theme, arbitrary, custom property, opacity)`,
|
|
3618
|
+
category: "interactivity"
|
|
3619
|
+
});
|
|
3620
|
+
}
|
|
3574
3621
|
const defaultTiming = "var(--default-transition-timing-function)";
|
|
3575
3622
|
const defaultDuration = "var(--default-transition-duration)";
|
|
3576
3623
|
staticUtility("transition", [
|
|
@@ -3708,53 +3755,99 @@ staticUtility("border-collapse", [["border-collapse", "collapse"]], { category:
|
|
|
3708
3755
|
staticUtility("border-separate", [["border-collapse", "separate"]], { category: "table" });
|
|
3709
3756
|
staticUtility("table-auto", [["table-layout", "auto"]], { category: "table" });
|
|
3710
3757
|
staticUtility("table-fixed", [["table-layout", "fixed"]], { category: "table" });
|
|
3711
|
-
|
|
3712
|
-
|
|
3713
|
-
|
|
3714
|
-
|
|
3715
|
-
|
|
3716
|
-
|
|
3717
|
-
|
|
3718
|
-
|
|
3719
|
-
|
|
3720
|
-
|
|
3721
|
-
|
|
3722
|
-
|
|
3723
|
-
|
|
3724
|
-
|
|
3725
|
-
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3739
|
-
|
|
3740
|
-
});
|
|
3741
|
-
functionalUtility({
|
|
3742
|
-
name: "border-spacing",
|
|
3743
|
-
prop: "border-spacing",
|
|
3744
|
-
supportsArbitrary: true,
|
|
3745
|
-
supportsCustomProperty: true,
|
|
3746
|
-
handle: (value, _ctx, _token) => {
|
|
3747
|
-
if (parseNumber(value)) {
|
|
3748
|
-
return [decl("border-spacing", `calc(var(--spacing) * ${value})`)];
|
|
3749
|
-
}
|
|
3750
|
-
return [decl("border-spacing", value)];
|
|
3751
|
-
},
|
|
3752
|
-
handleCustomProperty: (value) => [decl("border-spacing", `var(${value})`)],
|
|
3753
|
-
description: "border-spacing utility (static, number, arbitrary, custom property supported)",
|
|
3754
|
-
category: "table"
|
|
3758
|
+
const borderSpacingProperties = () => atRoot([
|
|
3759
|
+
property("--baro-border-spacing-x", "0", "<length>"),
|
|
3760
|
+
property("--baro-border-spacing-y", "0", "<length>")
|
|
3761
|
+
]);
|
|
3762
|
+
const BORDER_SPACING = "var(--baro-border-spacing-x) var(--baro-border-spacing-y)";
|
|
3763
|
+
const borderSpacing = (axes, v) => [
|
|
3764
|
+
borderSpacingProperties(),
|
|
3765
|
+
...axes.map((a) => decl(`--baro-border-spacing-${a}`, v)),
|
|
3766
|
+
decl("border-spacing", BORDER_SPACING)
|
|
3767
|
+
];
|
|
3768
|
+
[
|
|
3769
|
+
["border-spacing-x", ["x"]],
|
|
3770
|
+
["border-spacing-y", ["y"]],
|
|
3771
|
+
["border-spacing", ["x", "y"]]
|
|
3772
|
+
].forEach(([name, axes]) => {
|
|
3773
|
+
staticUtility(`${name}-px`, [
|
|
3774
|
+
borderSpacingProperties,
|
|
3775
|
+
...axes.map((a) => [`--baro-border-spacing-${a}`, "1px"]),
|
|
3776
|
+
["border-spacing", BORDER_SPACING]
|
|
3777
|
+
], { category: "table" });
|
|
3778
|
+
functionalUtility({
|
|
3779
|
+
name,
|
|
3780
|
+
prop: "border-spacing",
|
|
3781
|
+
supportsArbitrary: true,
|
|
3782
|
+
supportsCustomProperty: true,
|
|
3783
|
+
handle: (value) => borderSpacing(axes, parseNumber(value) ? `calc(var(--spacing) * ${value})` : value),
|
|
3784
|
+
handleCustomProperty: (value) => borderSpacing(axes, `var(${value})`),
|
|
3785
|
+
description: `${name} utility (number, px, arbitrary, custom property supported)`,
|
|
3786
|
+
category: "table"
|
|
3787
|
+
});
|
|
3755
3788
|
});
|
|
3756
3789
|
staticUtility("caption-top", [["caption-side", "top"]], { category: "table" });
|
|
3757
3790
|
staticUtility("caption-bottom", [["caption-side", "bottom"]], { category: "table" });
|
|
3791
|
+
function parseAlpha(op) {
|
|
3792
|
+
if (!op) return null;
|
|
3793
|
+
if (/^\d+(\.\d+)?$/.test(op)) return { alpha: `${op}%`, isVar: false };
|
|
3794
|
+
const pct = /^\[(\d+(?:\.\d+)?)%\]$/.exec(op);
|
|
3795
|
+
if (pct) return { alpha: `${pct[1]}%`, isVar: false };
|
|
3796
|
+
const cp = /^\((--[\w-]+)\)$/.exec(op);
|
|
3797
|
+
if (cp) return { alpha: `var(${cp[1]})`, isVar: true };
|
|
3798
|
+
return null;
|
|
3799
|
+
}
|
|
3800
|
+
function splitTop(value, sep) {
|
|
3801
|
+
const out = [];
|
|
3802
|
+
let depth = 0;
|
|
3803
|
+
let cur = "";
|
|
3804
|
+
for (const ch of value) {
|
|
3805
|
+
if (ch === "(") depth++;
|
|
3806
|
+
else if (ch === ")") depth--;
|
|
3807
|
+
if (depth === 0 && (sep === " " ? /\s/.test(ch) : ch === sep)) {
|
|
3808
|
+
if (cur.trim()) out.push(cur.trim());
|
|
3809
|
+
cur = "";
|
|
3810
|
+
} else cur += ch;
|
|
3811
|
+
}
|
|
3812
|
+
if (cur.trim()) out.push(cur.trim());
|
|
3813
|
+
return out;
|
|
3814
|
+
}
|
|
3815
|
+
const LENGTH = /^-?(\d*\.)?\d+([a-z]+|%)?$/i;
|
|
3816
|
+
function shadowLayers(value, layer, alpha) {
|
|
3817
|
+
return splitTop(value, ",").map((l) => {
|
|
3818
|
+
const parts = splitTop(l, " ");
|
|
3819
|
+
const i = parts.findIndex((p) => p !== "inset" && !LENGTH.test(p));
|
|
3820
|
+
const c = i < 0 ? "currentcolor" : parts[i];
|
|
3821
|
+
parts[i < 0 ? parts.length : i] = `var(--baro-${layer}-color, ${alpha ? `oklab(from ${c} l a b / ${alpha})` : c})`;
|
|
3822
|
+
return parts.join(" ");
|
|
3823
|
+
});
|
|
3824
|
+
}
|
|
3825
|
+
function shadowValueDecls(layer, prop, value, opacity, render = (l) => l.join(", ")) {
|
|
3826
|
+
const a = parseAlpha(opacity);
|
|
3827
|
+
if (opacity && !a) return null;
|
|
3828
|
+
if (!a) return [decl(prop, render(shadowLayers(value, layer)))];
|
|
3829
|
+
const alphaDecl = decl(`--baro-${layer}-alpha`, a.alpha);
|
|
3830
|
+
if (!a.isVar) return [alphaDecl, decl(prop, render(shadowLayers(value, layer, a.alpha)))];
|
|
3831
|
+
return [
|
|
3832
|
+
alphaDecl,
|
|
3833
|
+
decl(prop, render(shadowLayers(value, layer))),
|
|
3834
|
+
atRule("supports", "(color: lab(from red l a b))", [decl(prop, render(shadowLayers(value, layer, a.alpha)))])
|
|
3835
|
+
];
|
|
3836
|
+
}
|
|
3837
|
+
function shadowColorDecls(layer, color, opacity, ref = color) {
|
|
3838
|
+
const key = `--baro-${layer}-color`;
|
|
3839
|
+
if (color === "inherit") return [decl(key, "inherit")];
|
|
3840
|
+
const a = parseAlpha(opacity);
|
|
3841
|
+
if (opacity && !a) return null;
|
|
3842
|
+
const inner = a ? `color-mix(in oklab, ${ref} ${a.alpha}, transparent)` : ref;
|
|
3843
|
+
const fallback = a ? `color-mix(in srgb, ${color} ${a.alpha}, transparent)` : color;
|
|
3844
|
+
return [
|
|
3845
|
+
decl(key, fallback),
|
|
3846
|
+
atRule("supports", "(color: color-mix(in lab, red, red))", [
|
|
3847
|
+
decl(key, `color-mix(in oklab, ${inner} var(--baro-${layer}-alpha), transparent)`)
|
|
3848
|
+
])
|
|
3849
|
+
];
|
|
3850
|
+
}
|
|
3758
3851
|
staticUtility("filter-none", [["filter", "none"]], { category: "effects" });
|
|
3759
3852
|
functionalUtility({
|
|
3760
3853
|
name: "filter",
|
|
@@ -3839,57 +3932,68 @@ functionalUtility({
|
|
|
3839
3932
|
description: "contrast filter utility (static, number, arbitrary, custom property supported)",
|
|
3840
3933
|
category: "effects"
|
|
3841
3934
|
});
|
|
3842
|
-
[
|
|
3843
|
-
|
|
3844
|
-
|
|
3845
|
-
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3849
|
-
|
|
3850
|
-
|
|
3851
|
-
|
|
3852
|
-
|
|
3853
|
-
|
|
3854
|
-
|
|
3855
|
-
|
|
3856
|
-
|
|
3857
|
-
|
|
3858
|
-
|
|
3859
|
-
|
|
3860
|
-
|
|
3861
|
-
|
|
3862
|
-
|
|
3863
|
-
|
|
3864
|
-
|
|
3865
|
-
|
|
3935
|
+
const dropShadowProperties = () => atRoot([
|
|
3936
|
+
property("--baro-drop-shadow"),
|
|
3937
|
+
property("--baro-drop-shadow-color"),
|
|
3938
|
+
property("--baro-drop-shadow-alpha", "100%", "<percentage>"),
|
|
3939
|
+
property("--baro-drop-shadow-size")
|
|
3940
|
+
]);
|
|
3941
|
+
const wrapDropShadow = (layers) => layers.map((l) => `drop-shadow(${l})`).join(" ");
|
|
3942
|
+
const DROP_SHADOW_DEFAULT = "0 1px 2px rgb(0 0 0 / 0.1), 0 1px 1px rgb(0 0 0 / 0.06)";
|
|
3943
|
+
const namedDropShadow = (ctx, name) => {
|
|
3944
|
+
const v = ctx.theme("dropShadow", name);
|
|
3945
|
+
return typeof v === "string" && /^[\w.-]+$/.test(name) ? v : null;
|
|
3946
|
+
};
|
|
3947
|
+
function dropShadowValue(value, opacity, named, keepNamed = false) {
|
|
3948
|
+
const decls = shadowValueDecls("drop-shadow", "--baro-drop-shadow-size", value, opacity, wrapDropShadow);
|
|
3949
|
+
if (!decls) return null;
|
|
3950
|
+
const composed = named !== void 0 && (!opacity || keepNamed) ? named : "var(--baro-drop-shadow-size)";
|
|
3951
|
+
return [dropShadowProperties(), ...decls, decl("--baro-drop-shadow", composed), filters$1()];
|
|
3952
|
+
}
|
|
3953
|
+
staticUtility("drop-shadow-none", [decl("--baro-drop-shadow", " "), filters$1()]);
|
|
3954
|
+
registerUtility({
|
|
3955
|
+
name: "drop-shadow",
|
|
3956
|
+
match: (className) => /^drop-shadow(\/.+)?$/.test(className),
|
|
3957
|
+
handler: (value, _ctx, token) => {
|
|
3958
|
+
const full = value ? `${token.prefix}-${value}` : token.prefix;
|
|
3959
|
+
const cut = full.indexOf("/");
|
|
3960
|
+
const opacity = cut < 0 ? void 0 : full.slice(cut + 1);
|
|
3961
|
+
const literal = "drop-shadow(0 1px 2px rgb(0 0 0 / 0.1)) drop-shadow( 0 1px 1px rgb(0 0 0 / 0.06))";
|
|
3962
|
+
return dropShadowValue(DROP_SHADOW_DEFAULT, opacity, literal, true) ?? [];
|
|
3963
|
+
},
|
|
3964
|
+
category: "effects"
|
|
3866
3965
|
});
|
|
3966
|
+
const dropShadowColor = (color, opacity, ref) => {
|
|
3967
|
+
const decls = shadowColorDecls("drop-shadow", color, opacity, ref);
|
|
3968
|
+
return decls && [dropShadowProperties(), ...decls, decl("--baro-drop-shadow", "var(--baro-drop-shadow-size)")];
|
|
3969
|
+
};
|
|
3867
3970
|
functionalUtility({
|
|
3868
3971
|
name: "drop-shadow",
|
|
3869
3972
|
themeKeys: ["colors"],
|
|
3870
3973
|
supportsArbitrary: true,
|
|
3871
3974
|
supportsCustomProperty: true,
|
|
3872
|
-
|
|
3873
|
-
|
|
3874
|
-
|
|
3875
|
-
|
|
3876
|
-
|
|
3877
|
-
|
|
3975
|
+
supportsOpacity: true,
|
|
3976
|
+
handleBareValue: ({ value, ctx }) => namedDropShadow(ctx, value) ? value : null,
|
|
3977
|
+
handle: (value, ctx, token, extra) => {
|
|
3978
|
+
const opacity = extra?.opacity;
|
|
3979
|
+
const keyword = token.arbitrary ? void 0 : { inherit: "inherit", current: "currentcolor", transparent: "transparent" }[extra?.realThemeValue ?? value];
|
|
3980
|
+
if (keyword) return dropShadowColor(keyword, opacity);
|
|
3981
|
+
if (extra?.realThemeValue) return dropShadowColor(value, opacity, `var(--color-${extra.realThemeValue})`);
|
|
3982
|
+
if (token.arbitrary) {
|
|
3983
|
+
if (parseColor(value)) return dropShadowColor(value, opacity);
|
|
3984
|
+
return dropShadowValue(value, opacity);
|
|
3878
3985
|
}
|
|
3879
|
-
|
|
3880
|
-
|
|
3881
|
-
|
|
3882
|
-
];
|
|
3986
|
+
const named = namedDropShadow(ctx, value);
|
|
3987
|
+
if (named) return dropShadowValue(named, opacity, `drop-shadow(var(--drop-shadow-${value}))`);
|
|
3988
|
+
return null;
|
|
3883
3989
|
},
|
|
3884
3990
|
handleCustomProperty: (value) => {
|
|
3885
|
-
if (value.startsWith("color:")) {
|
|
3886
|
-
return [
|
|
3887
|
-
decl("--baro-drop-shadow-color", `var(${value.replace("color:", "")})`)
|
|
3888
|
-
];
|
|
3889
|
-
}
|
|
3991
|
+
if (value.startsWith("color:")) return dropShadowColor(`var(${value.slice(6)})`, void 0) ?? [];
|
|
3890
3992
|
return [
|
|
3993
|
+
dropShadowProperties(),
|
|
3891
3994
|
decl("--baro-drop-shadow-size", `drop-shadow(var(${value}))`),
|
|
3892
|
-
decl("--baro-drop-shadow", `var(--baro-drop-shadow-size)`)
|
|
3995
|
+
decl("--baro-drop-shadow", `var(--baro-drop-shadow-size)`),
|
|
3996
|
+
filters$1()
|
|
3893
3997
|
];
|
|
3894
3998
|
},
|
|
3895
3999
|
description: "drop-shadow filter utility (static, arbitrary, custom property supported)",
|
|
@@ -4259,166 +4363,119 @@ const ringShadowProperties = () => atRoot([
|
|
|
4259
4363
|
property("--baro-ring-offset-width", "0px", "<length>"),
|
|
4260
4364
|
property("--baro-ring-offset-color", "#fff")
|
|
4261
4365
|
]);
|
|
4262
|
-
const
|
|
4263
|
-
|
|
4264
|
-
|
|
4265
|
-
|
|
4266
|
-
|
|
4267
|
-
|
|
4268
|
-
|
|
4269
|
-
|
|
4270
|
-
|
|
4271
|
-
|
|
4272
|
-
|
|
4273
|
-
|
|
4274
|
-
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4280
|
-
|
|
4281
|
-
|
|
4282
|
-
|
|
4283
|
-
|
|
4284
|
-
|
|
4285
|
-
|
|
4286
|
-
|
|
4287
|
-
|
|
4288
|
-
|
|
4289
|
-
|
|
4290
|
-
|
|
4291
|
-
|
|
4292
|
-
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
|
|
4297
|
-
|
|
4298
|
-
|
|
4299
|
-
|
|
4300
|
-
function createShadowThemeColor(key, main, opacity, realThemeValue) {
|
|
4301
|
-
let fallbackColor = main;
|
|
4302
|
-
const colorVar = `var(--color-${realThemeValue})`;
|
|
4303
|
-
let colorValue = colorVar;
|
|
4304
|
-
if (opacity) {
|
|
4305
|
-
colorValue = `color-mix(in oklab, color-mix(in oklab, ${colorVar} ${opacity}%, transparent) var(--baro-shadow-alpha),transparent)`;
|
|
4306
|
-
if (parseColor(main)) {
|
|
4307
|
-
if (main.startsWith("#")) {
|
|
4308
|
-
const opacityValue = Math.round(Number(opacity) / 100 * 255);
|
|
4309
|
-
fallbackColor = `${main}${opacityValue.toString(16).padStart(2, "0")}`;
|
|
4310
|
-
} else {
|
|
4311
|
-
fallbackColor = `color-mix(in oklab, ${main} ${opacity}%, transparent)`;
|
|
4312
|
-
}
|
|
4313
|
-
}
|
|
4314
|
-
}
|
|
4315
|
-
return [
|
|
4316
|
-
atRule("supports", "(color:color-mix(in lab, red, red))", [
|
|
4317
|
-
decl(key, colorValue)
|
|
4318
|
-
]),
|
|
4319
|
-
decl(key, fallbackColor)
|
|
4320
|
-
];
|
|
4366
|
+
const shadowColorProperties = (layer) => atRoot([
|
|
4367
|
+
property(`--baro-${layer}-color`),
|
|
4368
|
+
property(`--baro-${layer}-alpha`, "100%", "<percentage>")
|
|
4369
|
+
]);
|
|
4370
|
+
const NAMED_SHADOWS = {
|
|
4371
|
+
"": "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
4372
|
+
"2xs": "0 1px rgb(0 0 0 / 0.05)",
|
|
4373
|
+
xs: "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
4374
|
+
sm: "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
4375
|
+
md: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
4376
|
+
lg: "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
4377
|
+
xl: "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
4378
|
+
"2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
4379
|
+
inner: "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)"
|
|
4380
|
+
};
|
|
4381
|
+
const NAMED_INSET_SHADOWS = {
|
|
4382
|
+
"2xs": "inset 0 1px rgb(0 0 0 / 0.05)",
|
|
4383
|
+
xs: "inset 0 1px 1px rgb(0 0 0 / 0.05)",
|
|
4384
|
+
sm: "inset 0 2px 4px rgb(0 0 0 / 0.05)"
|
|
4385
|
+
};
|
|
4386
|
+
const INSET_EXTENSIONS = {
|
|
4387
|
+
md: "inset 0 4px 6px -1px rgb(0 0 0 / 0.05)",
|
|
4388
|
+
lg: "inset 0 10px 15px -3px rgb(0 0 0 / 0.05)",
|
|
4389
|
+
xl: "inset 0 20px 25px -5px rgb(0 0 0 / 0.05)",
|
|
4390
|
+
"2xl": "inset 0 25px 50px -12px rgb(0 0 0 / 0.05)"
|
|
4391
|
+
};
|
|
4392
|
+
const insetEach = (value) => value.split(/,(?![^(]*\))/).map((l) => `inset ${l.trim()}`).join(", ");
|
|
4393
|
+
const own = (table, key) => Object.prototype.hasOwnProperty.call(table, key);
|
|
4394
|
+
function boxShadowLayer(layer, value, opacity) {
|
|
4395
|
+
const decls = shadowValueDecls(layer, `--baro-${layer}`, value, opacity);
|
|
4396
|
+
if (!decls) return null;
|
|
4397
|
+
return [ringShadowProperties(), shadowColorProperties(layer), ...decls, decl("box-shadow", SHADOW_COMPOSITE)];
|
|
4398
|
+
}
|
|
4399
|
+
function namedBoxShadow(layer, name, opacity) {
|
|
4400
|
+
if (layer === "shadow") return own(NAMED_SHADOWS, name) ? boxShadowLayer(layer, NAMED_SHADOWS[name], opacity) : null;
|
|
4401
|
+
if (own(NAMED_INSET_SHADOWS, name)) return boxShadowLayer(layer, NAMED_INSET_SHADOWS[name], opacity);
|
|
4402
|
+
if (!opacity && own(INSET_EXTENSIONS, name)) return boxShadowLayer(layer, INSET_EXTENSIONS[name], void 0);
|
|
4403
|
+
return null;
|
|
4321
4404
|
}
|
|
4322
|
-
|
|
4405
|
+
staticUtility("shadow-none", [ringShadowProperties, ["--baro-shadow", "0 0 #0000"], ["box-shadow", SHADOW_COMPOSITE]], { category: "effects" });
|
|
4406
|
+
staticUtility("inset-shadow-none", [ringShadowProperties, ["--baro-inset-shadow", "inset 0 0 #0000"], ["box-shadow", SHADOW_COMPOSITE]], { category: "effects" });
|
|
4407
|
+
registerUtility({
|
|
4323
4408
|
name: "shadow",
|
|
4324
|
-
|
|
4325
|
-
|
|
4326
|
-
|
|
4327
|
-
|
|
4328
|
-
|
|
4329
|
-
const main = value;
|
|
4330
|
-
const opacity = extra?.opacity;
|
|
4331
|
-
const realThemeValue = extra?.realThemeValue;
|
|
4332
|
-
if (realThemeValue) {
|
|
4333
|
-
return createShadowThemeColor(
|
|
4334
|
-
"--baro-shadow-color",
|
|
4335
|
-
main,
|
|
4336
|
-
opacity,
|
|
4337
|
-
realThemeValue
|
|
4338
|
-
);
|
|
4339
|
-
}
|
|
4340
|
-
if (main.startsWith("color:")) {
|
|
4341
|
-
const cp = main.replace("color:", "");
|
|
4342
|
-
if (opacity) {
|
|
4343
|
-
return [
|
|
4344
|
-
decl(
|
|
4345
|
-
"--baro-shadow-color",
|
|
4346
|
-
`color-mix(in oklab, var(${cp}) ${opacity}%, transparent)`
|
|
4347
|
-
)
|
|
4348
|
-
];
|
|
4349
|
-
}
|
|
4350
|
-
return [decl("--baro-shadow-color", `var(${cp})`)];
|
|
4351
|
-
}
|
|
4352
|
-
if (token.arbitrary) {
|
|
4353
|
-
if (parseColor(main)) {
|
|
4354
|
-
if (opacity) {
|
|
4355
|
-
return [
|
|
4356
|
-
decl(
|
|
4357
|
-
"--baro-shadow-color",
|
|
4358
|
-
`color-mix(in oklab, ${main} ${opacity}%, transparent)`
|
|
4359
|
-
)
|
|
4360
|
-
];
|
|
4361
|
-
}
|
|
4362
|
-
return [decl("--baro-shadow-color", main)];
|
|
4363
|
-
}
|
|
4364
|
-
return shadowLayer(main);
|
|
4365
|
-
}
|
|
4366
|
-
if (main === "inherit" || main === "current" || main === "transparent") {
|
|
4367
|
-
return [
|
|
4368
|
-
decl("--baro-shadow-color", main === "current" ? "currentColor" : main)
|
|
4369
|
-
];
|
|
4370
|
-
}
|
|
4371
|
-
return null;
|
|
4409
|
+
match: (className) => /^shadow(\/.+)?$/.test(className),
|
|
4410
|
+
handler: (value, _ctx, token) => {
|
|
4411
|
+
const full = value ? `${token.prefix}-${value}` : token.prefix;
|
|
4412
|
+
const cut = full.indexOf("/");
|
|
4413
|
+
return namedBoxShadow("shadow", "", cut < 0 ? void 0 : full.slice(cut + 1)) ?? [];
|
|
4372
4414
|
},
|
|
4373
|
-
|
|
4415
|
+
category: "effects"
|
|
4374
4416
|
});
|
|
4417
|
+
const KEYWORD_COLORS = { inherit: "inherit", current: "currentcolor", transparent: "transparent" };
|
|
4418
|
+
function layerColor(layer, main, opacity, token, realThemeValue) {
|
|
4419
|
+
const keyword = token.arbitrary ? void 0 : KEYWORD_COLORS[realThemeValue ?? main];
|
|
4420
|
+
if (keyword) return shadowColorDecls(layer, keyword, opacity);
|
|
4421
|
+
if (realThemeValue) return shadowColorDecls(layer, main, opacity, `var(--color-${realThemeValue})`);
|
|
4422
|
+
if (main.startsWith("color:")) return shadowColorDecls(layer, `var(${main.slice(6)})`, opacity);
|
|
4423
|
+
if (token.arbitrary && parseColor(main)) return shadowColorDecls(layer, main, opacity);
|
|
4424
|
+
return void 0;
|
|
4425
|
+
}
|
|
4426
|
+
for (const layer of ["shadow", "inset-shadow"]) {
|
|
4427
|
+
functionalUtility({
|
|
4428
|
+
name: layer,
|
|
4429
|
+
supportsArbitrary: true,
|
|
4430
|
+
supportsCustomProperty: true,
|
|
4431
|
+
supportsOpacity: true,
|
|
4432
|
+
themeKeys: ["colors"],
|
|
4433
|
+
handleBareValue: ({ value, extra }) => namedBoxShadow(layer, value, extra?.opacity) ? value : null,
|
|
4434
|
+
handle: (value, _ctx, token, extra) => {
|
|
4435
|
+
const opacity = extra?.opacity;
|
|
4436
|
+
const named = !extra?.realThemeValue && !token.arbitrary ? namedBoxShadow(layer, value, opacity) : null;
|
|
4437
|
+
if (named) return named;
|
|
4438
|
+
const color = layerColor(layer, value, opacity, token, extra?.realThemeValue);
|
|
4439
|
+
if (color !== void 0) return color;
|
|
4440
|
+
if (token.arbitrary) return boxShadowLayer(layer, layer === "inset-shadow" ? insetEach(value) : value, opacity);
|
|
4441
|
+
return null;
|
|
4442
|
+
},
|
|
4443
|
+
handleCustomProperty: (value) => value.startsWith("color:") ? shadowColorDecls(layer, `var(${value.slice(6)})`, void 0) ?? [] : [ringShadowProperties(), decl(`--baro-${layer}`, layer === "inset-shadow" ? `inset var(${value})` : `var(${value})`), decl("box-shadow", SHADOW_COMPOSITE)]
|
|
4444
|
+
});
|
|
4445
|
+
}
|
|
4446
|
+
const textShadowProperties = () => atRoot([
|
|
4447
|
+
property("--baro-text-shadow-color"),
|
|
4448
|
+
property("--baro-text-shadow-alpha", "100%", "<percentage>")
|
|
4449
|
+
]);
|
|
4450
|
+
const namedTextShadow = (ctx, name) => {
|
|
4451
|
+
const v = ctx.theme("textShadow", name);
|
|
4452
|
+
return typeof v === "string" && /^[\w.-]+$/.test(name) ? v : null;
|
|
4453
|
+
};
|
|
4454
|
+
const textShadowValue = (value, opacity) => {
|
|
4455
|
+
const decls = shadowValueDecls("text-shadow", "text-shadow", value, opacity);
|
|
4456
|
+
return decls ? [textShadowProperties(), ...decls] : null;
|
|
4457
|
+
};
|
|
4458
|
+
staticUtility("text-shadow-none", [textShadowProperties, ["text-shadow", "none"]], { category: "effects" });
|
|
4375
4459
|
functionalUtility({
|
|
4376
|
-
name: "
|
|
4460
|
+
name: "text-shadow",
|
|
4377
4461
|
supportsArbitrary: true,
|
|
4378
4462
|
supportsCustomProperty: true,
|
|
4379
4463
|
supportsOpacity: true,
|
|
4380
|
-
themeKeys: ["colors"
|
|
4464
|
+
themeKeys: ["colors"],
|
|
4465
|
+
handleBareValue: ({ value, ctx }) => namedTextShadow(ctx, value) ? value : null,
|
|
4381
4466
|
handle: (value, ctx, token, extra) => {
|
|
4382
|
-
const main = value;
|
|
4383
4467
|
const opacity = extra?.opacity;
|
|
4384
|
-
|
|
4385
|
-
|
|
4386
|
-
return
|
|
4387
|
-
"--baro-inset-shadow-color",
|
|
4388
|
-
main,
|
|
4389
|
-
opacity,
|
|
4390
|
-
realThemeValue
|
|
4391
|
-
);
|
|
4392
|
-
}
|
|
4393
|
-
if (main.startsWith("color:")) {
|
|
4394
|
-
const cp = main.replace("color:", "");
|
|
4395
|
-
let colorValue = `var(${cp})`;
|
|
4396
|
-
if (opacity) {
|
|
4397
|
-
colorValue = `color-mix(in oklab, var(${cp}) ${opacity}%, transparent)`;
|
|
4398
|
-
}
|
|
4399
|
-
return [decl("--baro-inset-shadow-color", colorValue)];
|
|
4400
|
-
}
|
|
4401
|
-
if (token.arbitrary) {
|
|
4402
|
-
if (parseColor(main)) {
|
|
4403
|
-
let colorValue = main;
|
|
4404
|
-
if (opacity) {
|
|
4405
|
-
colorValue = `color-mix(in oklab, ${main} ${opacity}%, transparent)`;
|
|
4406
|
-
}
|
|
4407
|
-
return [decl("--baro-inset-shadow-color", colorValue)];
|
|
4408
|
-
}
|
|
4409
|
-
return [decl("box-shadow", `inset ${main}`)];
|
|
4410
|
-
}
|
|
4411
|
-
if (main === "inherit" || main === "current" || main === "transparent") {
|
|
4412
|
-
return [
|
|
4413
|
-
decl(
|
|
4414
|
-
"--baro-inset-shadow-color",
|
|
4415
|
-
main === "current" ? "currentColor" : main
|
|
4416
|
-
)
|
|
4417
|
-
];
|
|
4468
|
+
if (!extra?.realThemeValue && !token.arbitrary) {
|
|
4469
|
+
const named = namedTextShadow(ctx, value);
|
|
4470
|
+
if (named) return textShadowValue(named, opacity);
|
|
4418
4471
|
}
|
|
4472
|
+
const color = layerColor("text-shadow", value, opacity, token, extra?.realThemeValue);
|
|
4473
|
+
if (color !== void 0) return color && [textShadowProperties(), ...color];
|
|
4474
|
+
if (token.arbitrary) return textShadowValue(value, opacity);
|
|
4419
4475
|
return null;
|
|
4420
4476
|
},
|
|
4421
|
-
handleCustomProperty: (value) => [decl("
|
|
4477
|
+
handleCustomProperty: (value) => value.startsWith("color:") ? [textShadowProperties(), ...shadowColorDecls("text-shadow", `var(${value.slice(6)})`, void 0) ?? []] : [textShadowProperties(), decl("text-shadow", `var(${value})`)],
|
|
4478
|
+
category: "effects"
|
|
4422
4479
|
});
|
|
4423
4480
|
[
|
|
4424
4481
|
["ring", "1px"],
|
|
@@ -4961,12 +5018,15 @@ staticUtility("not-sr-only", [
|
|
|
4961
5018
|
], { category: "layout" });
|
|
4962
5019
|
staticUtility("@container", [["container-type", "inline-size"]], { category: "layout" });
|
|
4963
5020
|
staticUtility("@container-normal", [["container-type", "normal"]], { category: "layout" });
|
|
5021
|
+
staticUtility("@container-size", [["container-type", "size"]], { category: "layout" });
|
|
5022
|
+
const NAMED_CONTAINER = /^@container(-normal|-size)?\/([a-zA-Z0-9_-]+)$/;
|
|
5023
|
+
const CONTAINER_TYPE = { "": "inline-size", "-normal": "normal", "-size": "size" };
|
|
4964
5024
|
registerUtility({
|
|
4965
5025
|
name: "@container",
|
|
4966
|
-
match: (className) =>
|
|
5026
|
+
match: (className) => NAMED_CONTAINER.test(className),
|
|
4967
5027
|
handler: (_value, _ctx, token) => {
|
|
4968
|
-
const
|
|
4969
|
-
return
|
|
5028
|
+
const m = NAMED_CONTAINER.exec(`${token.prefix}${token.value ? `-${token.value}` : ""}`);
|
|
5029
|
+
return m ? [decl("container-type", CONTAINER_TYPE[m[1] ?? ""]), decl("container-name", m[2])] : null;
|
|
4970
5030
|
},
|
|
4971
5031
|
category: "layout"
|
|
4972
5032
|
});
|
|
@@ -5051,6 +5111,11 @@ staticUtility("sticky", [["position", "sticky"]], { category: "layout" });
|
|
|
5051
5111
|
[
|
|
5052
5112
|
["inset-x", "inset-inline"],
|
|
5053
5113
|
["inset-y", "inset-block"],
|
|
5114
|
+
// Tailwind 4.3 logical sides; registered before `inset` so their handler runs first for `inset-s-*` etc.
|
|
5115
|
+
["inset-s", "inset-inline-start"],
|
|
5116
|
+
["inset-e", "inset-inline-end"],
|
|
5117
|
+
["inset-bs", "inset-block-start"],
|
|
5118
|
+
["inset-be", "inset-block-end"],
|
|
5054
5119
|
["inset", "inset"],
|
|
5055
5120
|
["start", "inset-inline-start"],
|
|
5056
5121
|
["end", "inset-inline-end"],
|
|
@@ -5146,6 +5211,15 @@ functionalUtility({
|
|
|
5146
5211
|
description: "gap utility (number, arbitrary, custom property supported)",
|
|
5147
5212
|
category: "layout"
|
|
5148
5213
|
});
|
|
5214
|
+
functionalUtility({
|
|
5215
|
+
name: "zoom",
|
|
5216
|
+
prop: "zoom",
|
|
5217
|
+
supportsArbitrary: true,
|
|
5218
|
+
supportsCustomProperty: true,
|
|
5219
|
+
handleBareValue: ({ value }) => /^\d+$/.test(value) ? `${value}%` : null,
|
|
5220
|
+
description: "zoom utility (integer percent, arbitrary, custom property)",
|
|
5221
|
+
category: "layout"
|
|
5222
|
+
});
|
|
5149
5223
|
staticUtility("basis-full", [["flex-basis", "100%"]], { category: "flex-grid" });
|
|
5150
5224
|
staticUtility("basis-auto", [["flex-basis", "auto"]], { category: "flex-grid" });
|
|
5151
5225
|
staticUtility("basis-3xs", [["flex-basis", "var(--container-3xs)"]], { category: "flex-grid" });
|
|
@@ -5420,6 +5494,8 @@ functionalUtility({
|
|
|
5420
5494
|
// auto-cols-[minmax(0,2fr)]
|
|
5421
5495
|
supportsCustomProperty: true,
|
|
5422
5496
|
// auto-cols-(--my-auto-cols)
|
|
5497
|
+
handleBareValue: ({ value }) => parseNumber(value) ? `calc(var(--spacing) * ${value})` : null,
|
|
5498
|
+
// #310: auto-cols-4
|
|
5423
5499
|
handle: (value) => {
|
|
5424
5500
|
if (typeof value === "string") return [decl("grid-auto-columns", value)];
|
|
5425
5501
|
return null;
|
|
@@ -5439,6 +5515,8 @@ functionalUtility({
|
|
|
5439
5515
|
// auto-rows-[minmax(0,2fr)]
|
|
5440
5516
|
supportsCustomProperty: true,
|
|
5441
5517
|
// auto-rows-(--my-auto-rows)
|
|
5518
|
+
handleBareValue: ({ value }) => parseNumber(value) ? `calc(var(--spacing) * ${value})` : null,
|
|
5519
|
+
// #310: auto-rows-12
|
|
5442
5520
|
handle: (value) => {
|
|
5443
5521
|
if (typeof value === "string") return [decl("grid-auto-rows", value)];
|
|
5444
5522
|
return null;
|
|
@@ -5641,6 +5719,8 @@ functionalUtility({
|
|
|
5641
5719
|
["py", "padding-block"],
|
|
5642
5720
|
["ps", "padding-inline-start"],
|
|
5643
5721
|
["pe", "padding-inline-end"],
|
|
5722
|
+
["pbs", "padding-block-start"],
|
|
5723
|
+
["pbe", "padding-block-end"],
|
|
5644
5724
|
["pt", "padding-top"],
|
|
5645
5725
|
["pr", "padding-right"],
|
|
5646
5726
|
["pb", "padding-bottom"],
|
|
@@ -5664,6 +5744,8 @@ functionalUtility({
|
|
|
5664
5744
|
["my", "margin-block"],
|
|
5665
5745
|
["ms", "margin-inline-start"],
|
|
5666
5746
|
["me", "margin-inline-end"],
|
|
5747
|
+
["mbs", "margin-block-start"],
|
|
5748
|
+
["mbe", "margin-block-end"],
|
|
5667
5749
|
["mt", "margin-top"],
|
|
5668
5750
|
["mr", "margin-right"],
|
|
5669
5751
|
["mb", "margin-bottom"],
|
|
@@ -5989,6 +6071,41 @@ functionalUtility({
|
|
|
5989
6071
|
description: "max-width utility (spacing, fraction, arbitrary, custom property, static supported)",
|
|
5990
6072
|
category: "sizing"
|
|
5991
6073
|
});
|
|
6074
|
+
{
|
|
6075
|
+
const containers = ["3xs", "2xs", "xs", "sm", "md", "lg", "xl", "2xl", "3xl", "4xl", "5xl", "6xl", "7xl"].map(
|
|
6076
|
+
(k) => [k, `var(--container-${k})`]
|
|
6077
|
+
);
|
|
6078
|
+
const common = [["0", "0px"], ["px", "1px"], ["full", "100%"], ["min", "min-content"], ["max", "max-content"], ["fit", "fit-content"]];
|
|
6079
|
+
const inlineVp = [["screen", "100vw"], ["dvw", "100dvw"], ["lvw", "100lvw"], ["svw", "100svw"]];
|
|
6080
|
+
const blockVp = [["screen", "100vh"], ["dvh", "100dvh"], ["lvh", "100lvh"], ["svh", "100svh"], ["lh", "1lh"]];
|
|
6081
|
+
const families = [
|
|
6082
|
+
["inline", "inline-size", [...common, ["auto", "auto"], ...inlineVp, ...containers]],
|
|
6083
|
+
["min-inline", "min-inline-size", [...common, ["auto", "auto"], ...inlineVp, ...containers]],
|
|
6084
|
+
["max-inline", "max-inline-size", [...common, ["none", "none"], ...inlineVp, ...containers]],
|
|
6085
|
+
["block", "block-size", [...common, ["auto", "auto"], ...blockVp]],
|
|
6086
|
+
["min-block", "min-block-size", [...common, ["auto", "auto"], ...blockVp]],
|
|
6087
|
+
["max-block", "max-block-size", [...common, ["none", "none"], ...blockVp]]
|
|
6088
|
+
];
|
|
6089
|
+
for (const [name, prop, statics] of families) {
|
|
6090
|
+
for (const [key, value] of statics) staticUtility(`${name}-${key}`, [[prop, value]], { category: "sizing" });
|
|
6091
|
+
functionalUtility({
|
|
6092
|
+
spacingKeys: true,
|
|
6093
|
+
name,
|
|
6094
|
+
prop,
|
|
6095
|
+
supportsArbitrary: true,
|
|
6096
|
+
supportsCustomProperty: true,
|
|
6097
|
+
supportsFraction: true,
|
|
6098
|
+
handleBareValue: ({ value, token }) => {
|
|
6099
|
+
if (token.negative) return null;
|
|
6100
|
+
if (parseNumber(value)) return `calc(var(--spacing) * ${value})`;
|
|
6101
|
+
if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;
|
|
6102
|
+
return null;
|
|
6103
|
+
},
|
|
6104
|
+
description: `${prop} utility (spacing, fraction, arbitrary, custom property, keywords)`,
|
|
6105
|
+
category: "sizing"
|
|
6106
|
+
});
|
|
6107
|
+
}
|
|
6108
|
+
}
|
|
5992
6109
|
const leadingProperty = () => atRoot([property("--baro-leading")]);
|
|
5993
6110
|
staticUtility("font-sans", [["font-family", "var(--font-sans)"]], { category: "typography" });
|
|
5994
6111
|
staticUtility("font-serif", [["font-family", "var(--font-serif)"]], { category: "typography" });
|
|
@@ -6019,13 +6136,15 @@ functionalUtility({
|
|
|
6019
6136
|
name: "font",
|
|
6020
6137
|
supportsArbitrary: true,
|
|
6021
6138
|
supportsCustomProperty: true,
|
|
6022
|
-
handle: (value) => {
|
|
6139
|
+
handle: (value, _ctx, token) => {
|
|
6140
|
+
if (token.prefix !== "font") return null;
|
|
6023
6141
|
if (parseNumber(value)) {
|
|
6024
6142
|
return [decl("font-weight", value)];
|
|
6025
6143
|
}
|
|
6026
6144
|
return [decl("font-family", value)];
|
|
6027
6145
|
},
|
|
6028
|
-
handleCustomProperty: (value) => {
|
|
6146
|
+
handleCustomProperty: (value, _ctx, token) => {
|
|
6147
|
+
if (token.prefix !== "font") return null;
|
|
6029
6148
|
if (value.startsWith("font-name:")) {
|
|
6030
6149
|
return [decl("font-family", `var(${value.replace("font-name:", "")})`)];
|
|
6031
6150
|
}
|
|
@@ -6324,6 +6443,42 @@ functionalUtility({
|
|
|
6324
6443
|
description: "content utility (arbitrary, custom property supported)",
|
|
6325
6444
|
category: "typography"
|
|
6326
6445
|
});
|
|
6446
|
+
const placeholderColor = (value) => [rule("&::placeholder", [decl("color", value)])];
|
|
6447
|
+
staticUtility("placeholder-inherit", placeholderColor("inherit"), { category: "typography" });
|
|
6448
|
+
staticUtility("placeholder-current", placeholderColor("currentcolor"), { category: "typography" });
|
|
6449
|
+
staticUtility("placeholder-transparent", placeholderColor("transparent"), { category: "typography" });
|
|
6450
|
+
functionalUtility({
|
|
6451
|
+
name: "placeholder",
|
|
6452
|
+
themeKeys: ["colors"],
|
|
6453
|
+
supportsArbitrary: true,
|
|
6454
|
+
supportsCustomProperty: true,
|
|
6455
|
+
supportsOpacity: true,
|
|
6456
|
+
handle: (value, _ctx, _token, extra) => {
|
|
6457
|
+
if (extra?.realThemeValue) return [rule("&::placeholder", themeColorDecls("color", value, extra))];
|
|
6458
|
+
if (parseColor(value)) return placeholderColor(value);
|
|
6459
|
+
return null;
|
|
6460
|
+
},
|
|
6461
|
+
handleCustomProperty: (value) => placeholderColor(`var(${value})`),
|
|
6462
|
+
description: "placeholder color utility (theme, alpha, arbitrary, custom property)"
|
|
6463
|
+
});
|
|
6464
|
+
functionalUtility({
|
|
6465
|
+
name: "font-features",
|
|
6466
|
+
supportsArbitrary: true,
|
|
6467
|
+
supportsCustomProperty: true,
|
|
6468
|
+
handle: (value, _ctx, token) => token.arbitrary ? [decl("font-feature-settings", value)] : null,
|
|
6469
|
+
handleCustomProperty: (value) => [decl("font-feature-settings", `var(${value.replace(/^[a-z-]+:(?=--)/, "")})`)],
|
|
6470
|
+
description: "font-feature-settings utility (arbitrary, custom property)",
|
|
6471
|
+
category: "typography"
|
|
6472
|
+
});
|
|
6473
|
+
functionalUtility({
|
|
6474
|
+
name: "tab",
|
|
6475
|
+
prop: "tab-size",
|
|
6476
|
+
supportsArbitrary: true,
|
|
6477
|
+
supportsCustomProperty: true,
|
|
6478
|
+
handleBareValue: ({ value }) => /^\d+$/.test(value) ? value : null,
|
|
6479
|
+
description: "tab-size utility (integer, arbitrary, custom property)",
|
|
6480
|
+
category: "typography"
|
|
6481
|
+
});
|
|
6327
6482
|
const gradientStopProperties = () => {
|
|
6328
6483
|
return atRoot([
|
|
6329
6484
|
property("--baro-gradient-position"),
|
|
@@ -6655,6 +6810,11 @@ const withBorderStyle = (props, width) => [
|
|
|
6655
6810
|
[
|
|
6656
6811
|
["border-x", ["border-left-width", "border-right-width"]],
|
|
6657
6812
|
["border-y", ["border-top-width", "border-bottom-width"]],
|
|
6813
|
+
["border-bs", ["border-block-start-width"]],
|
|
6814
|
+
["border-be", ["border-block-end-width"]],
|
|
6815
|
+
["border-s", ["border-inline-start-width"]],
|
|
6816
|
+
// #311 (Tailwind 4.3)
|
|
6817
|
+
["border-e", ["border-inline-end-width"]],
|
|
6658
6818
|
["border-t", ["border-top-width"]],
|
|
6659
6819
|
["border-r", ["border-right-width"]],
|
|
6660
6820
|
["border-b", ["border-bottom-width"]],
|
|
@@ -6674,6 +6834,7 @@ const withBorderStyle = (props, width) => [
|
|
|
6674
6834
|
functionalUtility({
|
|
6675
6835
|
name,
|
|
6676
6836
|
themeKeys: ["borderWidth", "colors"],
|
|
6837
|
+
supportsOpacity: true,
|
|
6677
6838
|
supportsArbitrary: true,
|
|
6678
6839
|
supportsCustomProperty: true,
|
|
6679
6840
|
handleBareValue: ({ value }) => {
|
|
@@ -7654,9 +7815,10 @@ staticModifier("starting", ["&"], {
|
|
|
7654
7815
|
wrap: () => [atRule("starting-style", "", [], "starting")],
|
|
7655
7816
|
source: "starting"
|
|
7656
7817
|
});
|
|
7657
|
-
function createContainerParams(type, value, name) {
|
|
7818
|
+
function createContainerParams(type, value, name, negate = false) {
|
|
7658
7819
|
const condition = type === "min" ? "width >=" : "width <";
|
|
7659
|
-
|
|
7820
|
+
const query = `${negate ? "not " : ""}(${condition} ${value})`;
|
|
7821
|
+
return name ? `${name} ${query}` : query;
|
|
7660
7822
|
}
|
|
7661
7823
|
function createContainerRule(params, ast) {
|
|
7662
7824
|
return {
|
|
@@ -7825,17 +7987,17 @@ functionalModifier(
|
|
|
7825
7987
|
return result;
|
|
7826
7988
|
}
|
|
7827
7989
|
);
|
|
7828
|
-
const SIZE_VARIANT =
|
|
7990
|
+
const SIZE_VARIANT = /^(not-)?@(?:(min|max)-)?(\[[^\]]+\]|[a-zA-Z0-9.]+)(?:\/([a-zA-Z0-9_-]+))?$/;
|
|
7829
7991
|
functionalModifier(
|
|
7830
|
-
(mod) => SIZE_VARIANT.test(mod) &&
|
|
7992
|
+
(mod) => SIZE_VARIANT.test(mod) && !/^(?:not-)?@container(?:\/|$)/.test(mod),
|
|
7831
7993
|
void 0,
|
|
7832
7994
|
(mod, context) => {
|
|
7833
7995
|
const m = SIZE_VARIANT.exec(mod.type);
|
|
7834
7996
|
if (!m) return [];
|
|
7835
|
-
const [, type, size, name] = m;
|
|
7997
|
+
const [, not, type, size, name] = m;
|
|
7836
7998
|
const value = size.startsWith("[") ? size.slice(1, -1).replace(/_/g, " ") : context.theme("container." + size);
|
|
7837
7999
|
if (!value) return [];
|
|
7838
|
-
return [createContainerRule(createContainerParams(type === "max" ? "max" : "min", value, name), [])];
|
|
8000
|
+
return [createContainerRule(createContainerParams(type === "max" ? "max" : "min", value, name, !!not), [])];
|
|
7839
8001
|
}
|
|
7840
8002
|
);
|
|
7841
8003
|
const startsAtRule = (bracket) => /^[\s_]*@/.test(bracket);
|
|
@@ -7975,7 +8137,7 @@ functionalModifier(
|
|
|
7975
8137
|
}
|
|
7976
8138
|
);
|
|
7977
8139
|
functionalModifier(
|
|
7978
|
-
(mod) => /^not-/.test(mod),
|
|
8140
|
+
(mod) => /^not-/.test(mod) && !mod.startsWith("not-@"),
|
|
7979
8141
|
({ selector, mod }) => {
|
|
7980
8142
|
const m = /^not-(.+)$/.exec(mod.type);
|
|
7981
8143
|
return {
|
|
@@ -8042,7 +8204,8 @@ functionalModifier(
|
|
|
8042
8204
|
void 0
|
|
8043
8205
|
);
|
|
8044
8206
|
functionalModifier(
|
|
8045
|
-
(mod) => mod.startsWith("not-"),
|
|
8207
|
+
(mod) => mod.startsWith("not-") && !mod.startsWith("not-@"),
|
|
8208
|
+
// not-@… is container negation (#311)
|
|
8046
8209
|
({ selector, mod }) => {
|
|
8047
8210
|
const pseudo = mod.type.replace("not-", "");
|
|
8048
8211
|
if (pseudo.startsWith("[")) {
|