@barocss/kit 0.8.2 → 0.9.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/README.md +2 -0
- package/dist/index.cjs +278 -361
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +14 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.js +277 -362
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -436,6 +436,26 @@ function staticUtility(name, decls, opts, ctx) {
|
|
|
436
436
|
* category: 'layout',
|
|
437
437
|
* });
|
|
438
438
|
*/
|
|
439
|
+
/**
|
|
440
|
+
* #300: a theme key that no built-in utility names (`theme.extend.borderRadius.card`) still resolves, as in
|
|
441
|
+
* Tailwind 4 where `--radius-card` gives `rounded-card`. Only word keys that start with a letter (numbers stay
|
|
442
|
+
* bare values), never `DEFAULT`; unknown keys return null so the utility emits nothing (#213).
|
|
443
|
+
*/
|
|
444
|
+
function themeKeyEntry(ctx, namespace, key) {
|
|
445
|
+
if (key === "DEFAULT" || !/^[a-zA-Z][\w-]*$/.test(key) || typeof ctx?.theme !== "function") return void 0;
|
|
446
|
+
const table = ctx.theme(namespace);
|
|
447
|
+
if (!table || typeof table !== "object" || !Object.prototype.hasOwnProperty.call(table, key)) return void 0;
|
|
448
|
+
return table[key] ?? void 0;
|
|
449
|
+
}
|
|
450
|
+
/** #300: the literal value of `theme.<namespace>.<key>` when it is a string, else null. */
|
|
451
|
+
function themeKeyValue(ctx, namespace, key) {
|
|
452
|
+
const v = themeKeyEntry(ctx, namespace, key);
|
|
453
|
+
return typeof v === "string" ? v : null;
|
|
454
|
+
}
|
|
455
|
+
/** #300: `var(--<varPrefix>-<key>)` when `theme.<namespace>.<key>` exists (the :root var BaroCSS emits for it), else null. */
|
|
456
|
+
function themeKeyVar(ctx, namespace, key, varPrefix) {
|
|
457
|
+
return themeKeyEntry(ctx, namespace, key) === void 0 ? null : `var(--${varPrefix}-${key})`;
|
|
458
|
+
}
|
|
439
459
|
/** #261: `var(--spacing-<key>)` for a named (non-numeric) `theme.spacing` key, else null. */
|
|
440
460
|
function spacingKeyValue(ctx, key, negative) {
|
|
441
461
|
if (key === "px" || !/^[a-zA-Z][\w-]*$/.test(key) || ctx.theme("spacing", key) == null) return null;
|
|
@@ -478,12 +498,18 @@ function functionalUtility(opts, ctx) {
|
|
|
478
498
|
}
|
|
479
499
|
let themeValue;
|
|
480
500
|
if (opts.themeKey && ctx.theme) themeValue = themeScalar(ctx.theme(opts.themeKey, finalValue));
|
|
501
|
+
let namespace = themeValue !== void 0 ? opts.themeKey : void 0;
|
|
481
502
|
if (!themeValue && opts.themeKeys && ctx.theme) for (const key of opts.themeKeys) {
|
|
482
503
|
themeValue = themeScalar(ctx.theme(key, finalValue));
|
|
483
|
-
if (themeValue !== void 0)
|
|
504
|
+
if (themeValue !== void 0) {
|
|
505
|
+
namespace = key;
|
|
506
|
+
break;
|
|
507
|
+
}
|
|
484
508
|
}
|
|
485
509
|
if (themeValue !== void 0) {
|
|
486
|
-
extra.
|
|
510
|
+
extra.themeNamespace = namespace;
|
|
511
|
+
extra.themeKey = finalValue;
|
|
512
|
+
if (namespace === "colors" || !(opts.themeKeys ?? [opts.themeKey]).includes("colors")) extra.realThemeValue = finalValue;
|
|
487
513
|
finalValue = themeValue;
|
|
488
514
|
if (opts.prop) return [decl(opts.prop, finalValue)];
|
|
489
515
|
if (opts.handle) {
|
|
@@ -1209,6 +1235,14 @@ function boxShadowToCssVars(boxShadow) {
|
|
|
1209
1235
|
* fontSize: { xs: ['0.75rem', '1rem'], ... }
|
|
1210
1236
|
* → { '--text-xs': '0.75rem', '--text-xs--line-height': '1rem' }
|
|
1211
1237
|
*/
|
|
1238
|
+
/** The line height of a fontSize tuple: `['4rem', '1.1']` or Tailwind's `['4rem', { lineHeight: '1.1' }]` (#300). */
|
|
1239
|
+
function fontSizeLineHeight(value) {
|
|
1240
|
+
if (!Array.isArray(value)) return void 0;
|
|
1241
|
+
const second = value[1];
|
|
1242
|
+
if (typeof second === "string" || typeof second === "number") return String(second);
|
|
1243
|
+
const lh = second?.lineHeight;
|
|
1244
|
+
return lh == null ? void 0 : String(lh);
|
|
1245
|
+
}
|
|
1212
1246
|
function fontSizeToCssVars(fontSize) {
|
|
1213
1247
|
if (!fontSize) return {};
|
|
1214
1248
|
const result = {};
|
|
@@ -1216,7 +1250,8 @@ function fontSizeToCssVars(fontSize) {
|
|
|
1216
1250
|
const value = fontSize[key];
|
|
1217
1251
|
if (Array.isArray(value)) {
|
|
1218
1252
|
result[`--text-${key}`] = value[0];
|
|
1219
|
-
|
|
1253
|
+
const lineHeight = fontSizeLineHeight(value);
|
|
1254
|
+
if (lineHeight) result[`--text-${key}--line-height`] = lineHeight;
|
|
1220
1255
|
} else result[`--text-${key}`] = value;
|
|
1221
1256
|
}
|
|
1222
1257
|
return result;
|
|
@@ -2627,105 +2662,81 @@ textarea {
|
|
|
2627
2662
|
resize: vertical;
|
|
2628
2663
|
}
|
|
2629
2664
|
`;
|
|
2665
|
+
/**
|
|
2666
|
+
* Full preflight: a port of Tailwind CSS v4.3.3's preflight.css (MIT), rule for rule (#336).
|
|
2667
|
+
* `--theme(--x, fallback)` becomes `var(--x, fallback)`; the default sans/mono families also fall back to
|
|
2668
|
+
* `--font-sans`/`--font-mono` so a BaroCSS theme applies. Checked by tests/compat/preflight-336.test.ts.
|
|
2669
|
+
*/
|
|
2630
2670
|
var preflightFullCSS = `
|
|
2631
|
-
/* BaroCSS Preflight - Full
|
|
2632
|
-
/* =============================== */
|
|
2633
|
-
|
|
2634
|
-
/* Box sizing rules */
|
|
2671
|
+
/* BaroCSS Preflight - Full (Tailwind 4.3.3) */
|
|
2635
2672
|
*,
|
|
2636
|
-
|
|
2637
|
-
|
|
2673
|
+
::after,
|
|
2674
|
+
::before,
|
|
2675
|
+
::backdrop,
|
|
2676
|
+
::file-selector-button {
|
|
2638
2677
|
box-sizing: border-box;
|
|
2639
|
-
}
|
|
2640
|
-
|
|
2641
|
-
/* Remove default margin and padding; reset border to Tailwind v4's universal
|
|
2642
|
-
\`border: 0 solid\` so a bare border/border-t (width set by the utility, style
|
|
2643
|
-
otherwise \`none\`) renders. Width 0 keeps borders invisible until a utility
|
|
2644
|
-
sets one. */
|
|
2645
|
-
* {
|
|
2646
2678
|
margin: 0;
|
|
2647
2679
|
padding: 0;
|
|
2648
2680
|
border: 0 solid;
|
|
2649
2681
|
}
|
|
2650
2682
|
|
|
2651
|
-
|
|
2652
|
-
|
|
2653
|
-
min-height: 100vh;
|
|
2654
|
-
scroll-behavior: smooth;
|
|
2655
|
-
text-rendering: optimizeSpeed;
|
|
2683
|
+
html,
|
|
2684
|
+
:host {
|
|
2656
2685
|
line-height: 1.5;
|
|
2657
|
-
-webkit-
|
|
2658
|
-
-
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2662
|
-
|
|
2663
|
-
ol {
|
|
2664
|
-
list-style: none;
|
|
2665
|
-
}
|
|
2666
|
-
|
|
2667
|
-
/* Make images easier to work with */
|
|
2668
|
-
img,
|
|
2669
|
-
picture {
|
|
2670
|
-
max-width: 100%;
|
|
2671
|
-
display: block;
|
|
2672
|
-
}
|
|
2673
|
-
|
|
2674
|
-
/* Inherit fonts for inputs and buttons */
|
|
2675
|
-
input,
|
|
2676
|
-
button,
|
|
2677
|
-
textarea,
|
|
2678
|
-
select {
|
|
2679
|
-
font: inherit;
|
|
2686
|
+
-webkit-text-size-adjust: 100%;
|
|
2687
|
+
tab-size: 4;
|
|
2688
|
+
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'));
|
|
2689
|
+
font-feature-settings: var(--default-font-feature-settings, normal);
|
|
2690
|
+
font-variation-settings: var(--default-font-variation-settings, normal);
|
|
2691
|
+
-webkit-tap-highlight-color: transparent;
|
|
2680
2692
|
}
|
|
2681
2693
|
|
|
2682
|
-
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
|
|
2686
|
-
}
|
|
2687
|
-
|
|
2688
|
-
*,
|
|
2689
|
-
*::before,
|
|
2690
|
-
*::after {
|
|
2691
|
-
animation-duration: 0.01ms !important;
|
|
2692
|
-
animation-iteration-count: 1 !important;
|
|
2693
|
-
transition-duration: 0.01ms !important;
|
|
2694
|
-
scroll-behavior: auto !important;
|
|
2695
|
-
}
|
|
2694
|
+
hr {
|
|
2695
|
+
height: 0;
|
|
2696
|
+
color: inherit;
|
|
2697
|
+
border-top-width: 1px;
|
|
2696
2698
|
}
|
|
2697
2699
|
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
display: block;
|
|
2700
|
+
abbr:where([title]) {
|
|
2701
|
+
-webkit-text-decoration: underline dotted;
|
|
2702
|
+
text-decoration: underline dotted;
|
|
2702
2703
|
}
|
|
2703
2704
|
|
|
2704
|
-
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
|
|
2709
|
-
|
|
2710
|
-
font-
|
|
2711
|
-
font-
|
|
2712
|
-
font-variation-settings: var(--default-font-variation-settings, normal);
|
|
2705
|
+
h1,
|
|
2706
|
+
h2,
|
|
2707
|
+
h3,
|
|
2708
|
+
h4,
|
|
2709
|
+
h5,
|
|
2710
|
+
h6 {
|
|
2711
|
+
font-size: inherit;
|
|
2712
|
+
font-weight: inherit;
|
|
2713
2713
|
}
|
|
2714
2714
|
|
|
2715
|
-
/* Remove the gray background on active links in IE 10 */
|
|
2716
2715
|
a {
|
|
2717
|
-
background-color: transparent;
|
|
2718
|
-
text-decoration: none;
|
|
2719
2716
|
color: inherit;
|
|
2717
|
+
-webkit-text-decoration: inherit;
|
|
2718
|
+
text-decoration: inherit;
|
|
2720
2719
|
}
|
|
2721
2720
|
|
|
2722
|
-
/* Add the correct font weight in Chrome, Edge, and Safari */
|
|
2723
2721
|
b,
|
|
2724
2722
|
strong {
|
|
2725
2723
|
font-weight: bolder;
|
|
2726
2724
|
}
|
|
2727
2725
|
|
|
2728
|
-
|
|
2726
|
+
code,
|
|
2727
|
+
kbd,
|
|
2728
|
+
samp,
|
|
2729
|
+
pre {
|
|
2730
|
+
font-family: var(--default-mono-font-family, var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace));
|
|
2731
|
+
font-feature-settings: var(--default-mono-font-feature-settings, normal);
|
|
2732
|
+
font-variation-settings: var(--default-mono-font-variation-settings, normal);
|
|
2733
|
+
font-size: 1em;
|
|
2734
|
+
}
|
|
2735
|
+
|
|
2736
|
+
small {
|
|
2737
|
+
font-size: 80%;
|
|
2738
|
+
}
|
|
2739
|
+
|
|
2729
2740
|
sub,
|
|
2730
2741
|
sup {
|
|
2731
2742
|
font-size: 75%;
|
|
@@ -2742,265 +2753,49 @@ sup {
|
|
|
2742
2753
|
top: -0.5em;
|
|
2743
2754
|
}
|
|
2744
2755
|
|
|
2745
|
-
/* Improve media defaults */
|
|
2746
|
-
svg {
|
|
2747
|
-
vertical-align: middle;
|
|
2748
|
-
}
|
|
2749
|
-
|
|
2750
|
-
/* Remove border on iframe */
|
|
2751
|
-
iframe {
|
|
2752
|
-
border: 0;
|
|
2753
|
-
}
|
|
2754
|
-
|
|
2755
|
-
/* Table defaults */
|
|
2756
2756
|
table {
|
|
2757
|
+
text-indent: 0;
|
|
2758
|
+
border-color: inherit;
|
|
2757
2759
|
border-collapse: collapse;
|
|
2758
|
-
border-spacing: 0;
|
|
2759
|
-
}
|
|
2760
|
-
|
|
2761
|
-
/* Form element defaults */
|
|
2762
|
-
button,
|
|
2763
|
-
input,
|
|
2764
|
-
optgroup,
|
|
2765
|
-
select,
|
|
2766
|
-
textarea {
|
|
2767
|
-
font-family: inherit;
|
|
2768
|
-
font-size: 100%;
|
|
2769
|
-
line-height: 1.15;
|
|
2770
|
-
margin: 0;
|
|
2771
|
-
}
|
|
2772
|
-
|
|
2773
|
-
button,
|
|
2774
|
-
select {
|
|
2775
|
-
text-transform: none;
|
|
2776
|
-
}
|
|
2777
|
-
|
|
2778
|
-
button,
|
|
2779
|
-
[type="button"],
|
|
2780
|
-
[type="reset"],
|
|
2781
|
-
[type="submit"] {
|
|
2782
|
-
-webkit-appearance: button;
|
|
2783
2760
|
}
|
|
2784
2761
|
|
|
2785
|
-
|
|
2786
|
-
|
|
2787
|
-
[type="reset"]::-moz-focus-inner,
|
|
2788
|
-
[type="submit"]::-moz-focus-inner {
|
|
2789
|
-
border-style: none;
|
|
2790
|
-
padding: 0;
|
|
2791
|
-
}
|
|
2792
|
-
|
|
2793
|
-
button:-moz-focusring,
|
|
2794
|
-
[type="button"]:-moz-focusring,
|
|
2795
|
-
[type="reset"]:-moz-focusring,
|
|
2796
|
-
[type="submit"]:-moz-focusring {
|
|
2797
|
-
outline: 1px dotted ButtonText;
|
|
2798
|
-
}
|
|
2799
|
-
|
|
2800
|
-
/* Remove the inner border and padding in Firefox */
|
|
2801
|
-
button::-moz-focus-inner,
|
|
2802
|
-
[type="button"]::-moz-focus-inner,
|
|
2803
|
-
[type="reset"]::-moz-focus-inner,
|
|
2804
|
-
[type="submit"]::-moz-focus-inner {
|
|
2805
|
-
border-style: none;
|
|
2806
|
-
padding: 0;
|
|
2762
|
+
:-moz-focusring:where(:not(iframe)) {
|
|
2763
|
+
outline: auto;
|
|
2807
2764
|
}
|
|
2808
2765
|
|
|
2809
|
-
/* Restore the focus styles unset by the previous rule */
|
|
2810
|
-
button:-moz-focusring,
|
|
2811
|
-
[type="button"]:-moz-focusring,
|
|
2812
|
-
[type="reset"]:-moz-focusring,
|
|
2813
|
-
[type="submit"]:-moz-focusring {
|
|
2814
|
-
outline: 1px dotted ButtonText;
|
|
2815
|
-
}
|
|
2816
|
-
|
|
2817
|
-
/* Correct the padding in Firefox */
|
|
2818
|
-
fieldset {
|
|
2819
|
-
padding: 0.35em 0.75em 0.625em;
|
|
2820
|
-
}
|
|
2821
|
-
|
|
2822
|
-
/* Remove padding so developers aren't caught out when they zero out fieldset elements */
|
|
2823
|
-
legend {
|
|
2824
|
-
box-sizing: border-box;
|
|
2825
|
-
color: inherit;
|
|
2826
|
-
display: table;
|
|
2827
|
-
max-width: 100%;
|
|
2828
|
-
padding: 0;
|
|
2829
|
-
white-space: normal;
|
|
2830
|
-
}
|
|
2831
|
-
|
|
2832
|
-
/* Add the correct vertical alignment in Chrome, Firefox, and Opera */
|
|
2833
2766
|
progress {
|
|
2834
2767
|
vertical-align: baseline;
|
|
2835
2768
|
}
|
|
2836
2769
|
|
|
2837
|
-
|
|
2838
|
-
|
|
2839
|
-
overflow: auto;
|
|
2840
|
-
}
|
|
2841
|
-
|
|
2842
|
-
/* Correct the cursor style of increment and decrement buttons in Chrome */
|
|
2843
|
-
[type="number"]::-webkit-inner-spin-button,
|
|
2844
|
-
[type="number"]::-webkit-outer-spin-button {
|
|
2845
|
-
height: auto;
|
|
2846
|
-
}
|
|
2847
|
-
|
|
2848
|
-
/* Remove the inner padding in Chrome and Safari on macOS */
|
|
2849
|
-
[type="search"] {
|
|
2850
|
-
-webkit-appearance: textfield;
|
|
2851
|
-
outline-offset: -2px;
|
|
2852
|
-
}
|
|
2853
|
-
|
|
2854
|
-
/* Remove the inner padding in Chrome and Safari on macOS */
|
|
2855
|
-
[type="search"]::-webkit-search-decoration {
|
|
2856
|
-
-webkit-appearance: none;
|
|
2857
|
-
}
|
|
2858
|
-
|
|
2859
|
-
/* Remove the default vertical scrollbar in IE */
|
|
2860
|
-
textarea {
|
|
2861
|
-
overflow: auto;
|
|
2862
|
-
}
|
|
2863
|
-
|
|
2864
|
-
/* Correct the cursor style of increment and decrement buttons in Chrome */
|
|
2865
|
-
[type="number"]::-webkit-inner-spin-button,
|
|
2866
|
-
[type="number"]::-webkit-outer-spin-button {
|
|
2867
|
-
height: auto;
|
|
2868
|
-
}
|
|
2869
|
-
|
|
2870
|
-
/* Remove the inner padding in Chrome and Safari on macOS */
|
|
2871
|
-
[type="search"] {
|
|
2872
|
-
-webkit-appearance: textfield;
|
|
2873
|
-
outline-offset: -2px;
|
|
2874
|
-
}
|
|
2875
|
-
|
|
2876
|
-
/* Remove the inner padding in Chrome and Safari on macOS */
|
|
2877
|
-
[type="search"]::-webkit-search-decoration {
|
|
2878
|
-
-webkit-appearance: none;
|
|
2879
|
-
}
|
|
2880
|
-
|
|
2881
|
-
/* Additional full reset styles */
|
|
2882
|
-
abbr[title] {
|
|
2883
|
-
border-bottom: none;
|
|
2884
|
-
text-decoration: underline;
|
|
2885
|
-
text-decoration: underline dotted;
|
|
2886
|
-
}
|
|
2887
|
-
|
|
2888
|
-
/* Add the correct font size in all browsers */
|
|
2889
|
-
small {
|
|
2890
|
-
font-size: 80%;
|
|
2770
|
+
summary {
|
|
2771
|
+
display: list-item;
|
|
2891
2772
|
}
|
|
2892
2773
|
|
|
2893
|
-
|
|
2894
|
-
|
|
2895
|
-
|
|
2896
|
-
|
|
2897
|
-
samp {
|
|
2898
|
-
font-family: var(--default-mono-font-family, var(--font-mono, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace));
|
|
2899
|
-
font-feature-settings: var(--default-mono-font-feature-settings, normal);
|
|
2900
|
-
font-variation-settings: var(--default-mono-font-variation-settings, normal);
|
|
2901
|
-
font-size: 1em;
|
|
2774
|
+
ol,
|
|
2775
|
+
ul,
|
|
2776
|
+
menu {
|
|
2777
|
+
list-style: none;
|
|
2902
2778
|
}
|
|
2903
2779
|
|
|
2904
|
-
|
|
2780
|
+
img,
|
|
2781
|
+
svg,
|
|
2782
|
+
video,
|
|
2783
|
+
canvas,
|
|
2905
2784
|
audio,
|
|
2906
|
-
|
|
2907
|
-
|
|
2908
|
-
|
|
2909
|
-
|
|
2910
|
-
|
|
2911
|
-
template {
|
|
2912
|
-
display: none;
|
|
2913
|
-
}
|
|
2914
|
-
|
|
2915
|
-
/* Hidden attribute */
|
|
2916
|
-
[hidden] {
|
|
2917
|
-
display: none;
|
|
2918
|
-
}
|
|
2919
|
-
|
|
2920
|
-
/* Focus styles */
|
|
2921
|
-
:focus {
|
|
2922
|
-
outline: 2px solid #3b82f6;
|
|
2923
|
-
outline-offset: 2px;
|
|
2924
|
-
}
|
|
2925
|
-
|
|
2926
|
-
/* Skip link for accessibility */
|
|
2927
|
-
.skip-link {
|
|
2928
|
-
position: absolute;
|
|
2929
|
-
top: -40px;
|
|
2930
|
-
left: 6px;
|
|
2931
|
-
background: #000;
|
|
2932
|
-
color: white;
|
|
2933
|
-
padding: 8px;
|
|
2934
|
-
text-decoration: none;
|
|
2935
|
-
z-index: 100;
|
|
2936
|
-
}
|
|
2937
|
-
|
|
2938
|
-
.skip-link:focus {
|
|
2939
|
-
top: 6px;
|
|
2785
|
+
iframe,
|
|
2786
|
+
embed,
|
|
2787
|
+
object {
|
|
2788
|
+
display: block;
|
|
2789
|
+
vertical-align: middle;
|
|
2940
2790
|
}
|
|
2941
2791
|
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
*::after {
|
|
2947
|
-
background: transparent !important;
|
|
2948
|
-
color: #000 !important;
|
|
2949
|
-
box-shadow: none !important;
|
|
2950
|
-
text-shadow: none !important;
|
|
2951
|
-
}
|
|
2952
|
-
|
|
2953
|
-
a,
|
|
2954
|
-
a:visited {
|
|
2955
|
-
text-decoration: underline;
|
|
2956
|
-
}
|
|
2957
|
-
|
|
2958
|
-
a[href]:after {
|
|
2959
|
-
content: " (" attr(href) ")";
|
|
2960
|
-
}
|
|
2961
|
-
|
|
2962
|
-
abbr[title]:after {
|
|
2963
|
-
content: " (" attr(title) ")";
|
|
2964
|
-
}
|
|
2965
|
-
|
|
2966
|
-
a[href^="#"]:after,
|
|
2967
|
-
a[href^="javascript:"]:after {
|
|
2968
|
-
content: "";
|
|
2969
|
-
}
|
|
2970
|
-
|
|
2971
|
-
pre,
|
|
2972
|
-
blockquote {
|
|
2973
|
-
border: 1px solid #999;
|
|
2974
|
-
page-break-inside: avoid;
|
|
2975
|
-
}
|
|
2976
|
-
|
|
2977
|
-
thead {
|
|
2978
|
-
display: table-header-group;
|
|
2979
|
-
}
|
|
2980
|
-
|
|
2981
|
-
tr,
|
|
2982
|
-
img {
|
|
2983
|
-
page-break-inside: avoid;
|
|
2984
|
-
}
|
|
2985
|
-
|
|
2986
|
-
img {
|
|
2987
|
-
max-width: 100% !important;
|
|
2988
|
-
}
|
|
2989
|
-
|
|
2990
|
-
p,
|
|
2991
|
-
h2,
|
|
2992
|
-
h3 {
|
|
2993
|
-
orphans: 3;
|
|
2994
|
-
widows: 3;
|
|
2995
|
-
}
|
|
2996
|
-
|
|
2997
|
-
h2,
|
|
2998
|
-
h3 {
|
|
2999
|
-
page-break-after: avoid;
|
|
3000
|
-
}
|
|
2792
|
+
img,
|
|
2793
|
+
video {
|
|
2794
|
+
max-width: 100%;
|
|
2795
|
+
height: auto;
|
|
3001
2796
|
}
|
|
3002
2797
|
|
|
3003
|
-
/*
|
|
2798
|
+
/* form-control reset */
|
|
3004
2799
|
button,
|
|
3005
2800
|
input,
|
|
3006
2801
|
select,
|
|
@@ -3033,7 +2828,8 @@ textarea,
|
|
|
3033
2828
|
opacity: 1;
|
|
3034
2829
|
}
|
|
3035
2830
|
|
|
3036
|
-
@supports (not (-webkit-appearance: -apple-pay-button)) or
|
|
2831
|
+
@supports (not (-webkit-appearance: -apple-pay-button)) or
|
|
2832
|
+
(contain-intrinsic-size: 1px) {
|
|
3037
2833
|
::placeholder {
|
|
3038
2834
|
color: color-mix(in oklab, currentcolor 50%, transparent);
|
|
3039
2835
|
}
|
|
@@ -3042,6 +2838,58 @@ textarea,
|
|
|
3042
2838
|
textarea {
|
|
3043
2839
|
resize: vertical;
|
|
3044
2840
|
}
|
|
2841
|
+
|
|
2842
|
+
::-webkit-search-decoration {
|
|
2843
|
+
-webkit-appearance: none;
|
|
2844
|
+
}
|
|
2845
|
+
|
|
2846
|
+
::-webkit-date-and-time-value {
|
|
2847
|
+
min-height: 1lh;
|
|
2848
|
+
text-align: inherit;
|
|
2849
|
+
}
|
|
2850
|
+
|
|
2851
|
+
::-webkit-datetime-edit {
|
|
2852
|
+
display: inline-flex;
|
|
2853
|
+
}
|
|
2854
|
+
|
|
2855
|
+
::-webkit-datetime-edit-fields-wrapper {
|
|
2856
|
+
padding: 0;
|
|
2857
|
+
}
|
|
2858
|
+
|
|
2859
|
+
::-webkit-datetime-edit,
|
|
2860
|
+
::-webkit-datetime-edit-year-field,
|
|
2861
|
+
::-webkit-datetime-edit-month-field,
|
|
2862
|
+
::-webkit-datetime-edit-day-field,
|
|
2863
|
+
::-webkit-datetime-edit-hour-field,
|
|
2864
|
+
::-webkit-datetime-edit-minute-field,
|
|
2865
|
+
::-webkit-datetime-edit-second-field,
|
|
2866
|
+
::-webkit-datetime-edit-millisecond-field,
|
|
2867
|
+
::-webkit-datetime-edit-meridiem-field {
|
|
2868
|
+
padding-block: 0;
|
|
2869
|
+
}
|
|
2870
|
+
|
|
2871
|
+
::-webkit-calendar-picker-indicator {
|
|
2872
|
+
line-height: 1;
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2875
|
+
:-moz-ui-invalid {
|
|
2876
|
+
box-shadow: none;
|
|
2877
|
+
}
|
|
2878
|
+
|
|
2879
|
+
button,
|
|
2880
|
+
input:where([type='button'], [type='reset'], [type='submit']),
|
|
2881
|
+
::file-selector-button {
|
|
2882
|
+
appearance: button;
|
|
2883
|
+
}
|
|
2884
|
+
|
|
2885
|
+
::-webkit-inner-spin-button,
|
|
2886
|
+
::-webkit-outer-spin-button {
|
|
2887
|
+
height: auto;
|
|
2888
|
+
}
|
|
2889
|
+
|
|
2890
|
+
[hidden]:where(:not([hidden='until-found'])) {
|
|
2891
|
+
display: none !important;
|
|
2892
|
+
}
|
|
3045
2893
|
`;
|
|
3046
2894
|
//#endregion
|
|
3047
2895
|
//#region src/core/context.ts
|
|
@@ -3953,6 +3801,7 @@ functionalUtility({
|
|
|
3953
3801
|
prop: "transition-timing-function",
|
|
3954
3802
|
supportsArbitrary: true,
|
|
3955
3803
|
supportsCustomProperty: true,
|
|
3804
|
+
handleBareValue: ({ value, ctx }) => themeKeyVar(ctx, "transitionTimingFunction", value, "ease") ?? (/^(\d|\.\d)/.test(value) ? value : null),
|
|
3956
3805
|
handle: (value, _ctx, _token) => {
|
|
3957
3806
|
return [decl("transition-timing-function", value)];
|
|
3958
3807
|
},
|
|
@@ -4137,6 +3986,7 @@ functionalUtility({
|
|
|
4137
3986
|
prop: "filter",
|
|
4138
3987
|
supportsArbitrary: true,
|
|
4139
3988
|
supportsCustomProperty: true,
|
|
3989
|
+
handleBareValue: ({ value, ctx }) => themeKeyVar(ctx, "blur", value, "blur") ?? (/^(\d|\.\d)/.test(value) ? value : null),
|
|
4140
3990
|
handle: (value, _ctx, token) => {
|
|
4141
3991
|
if (token.customProperty) return [decl("--baro-blur", `blur(var(${value}))`), filters$1()];
|
|
4142
3992
|
return [decl("--baro-blur", `blur(${value})`), filters$1()];
|
|
@@ -4232,13 +4082,14 @@ functionalUtility({
|
|
|
4232
4082
|
transparent: "transparent"
|
|
4233
4083
|
}[extra?.realThemeValue ?? value];
|
|
4234
4084
|
if (keyword) return dropShadowColor(keyword, opacity);
|
|
4085
|
+
const key = extra?.realThemeValue ?? value;
|
|
4086
|
+
const named = token.arbitrary ? null : namedDropShadow(ctx, key);
|
|
4087
|
+
if (named) return dropShadowValue(named, opacity, `drop-shadow(var(--drop-shadow-${key}))`);
|
|
4235
4088
|
if (extra?.realThemeValue) return dropShadowColor(value, opacity, `var(--color-${extra.realThemeValue})`);
|
|
4236
4089
|
if (token.arbitrary) {
|
|
4237
4090
|
if (parseColor(value)) return dropShadowColor(value, opacity);
|
|
4238
4091
|
return dropShadowValue(value, opacity);
|
|
4239
4092
|
}
|
|
4240
|
-
const named = namedDropShadow(ctx, value);
|
|
4241
|
-
if (named) return dropShadowValue(named, opacity, `drop-shadow(var(--drop-shadow-${value}))`);
|
|
4242
4093
|
return null;
|
|
4243
4094
|
},
|
|
4244
4095
|
handleCustomProperty: (value) => {
|
|
@@ -4356,6 +4207,7 @@ functionalUtility({
|
|
|
4356
4207
|
prop: "backdrop-filter",
|
|
4357
4208
|
supportsArbitrary: true,
|
|
4358
4209
|
supportsCustomProperty: true,
|
|
4210
|
+
handleBareValue: ({ value, ctx }) => themeKeyVar(ctx, "blur", value, "blur") ?? (/^(\d|\.\d)/.test(value) ? value : null),
|
|
4359
4211
|
handle: (value, _ctx, token) => {
|
|
4360
4212
|
if (token.customProperty) return [decl("--baro-backdrop-blur", `blur(var(${value}))`), ...filters()];
|
|
4361
4213
|
return [decl("--baro-backdrop-blur", `blur(${value})`), ...filters()];
|
|
@@ -4511,11 +4363,15 @@ function boxShadowLayer(layer, value, opacity) {
|
|
|
4511
4363
|
decl("box-shadow", SHADOW_COMPOSITE)
|
|
4512
4364
|
];
|
|
4513
4365
|
}
|
|
4514
|
-
function namedBoxShadow(layer, name, opacity) {
|
|
4515
|
-
if (layer === "shadow")
|
|
4516
|
-
|
|
4517
|
-
|
|
4518
|
-
|
|
4366
|
+
function namedBoxShadow(layer, name, opacity, ctx) {
|
|
4367
|
+
if (layer === "shadow") {
|
|
4368
|
+
if (own(NAMED_SHADOWS, name)) return boxShadowLayer(layer, NAMED_SHADOWS[name], opacity);
|
|
4369
|
+
} else {
|
|
4370
|
+
if (own(NAMED_INSET_SHADOWS, name)) return boxShadowLayer(layer, NAMED_INSET_SHADOWS[name], opacity);
|
|
4371
|
+
if (!opacity && own(INSET_EXTENSIONS, name)) return boxShadowLayer(layer, INSET_EXTENSIONS[name], void 0);
|
|
4372
|
+
}
|
|
4373
|
+
const custom = ctx && name !== "none" ? themeKeyValue(ctx, layer === "shadow" ? "boxShadow" : "insetShadow", name) : null;
|
|
4374
|
+
return custom ? boxShadowLayer(layer, custom, opacity) : null;
|
|
4519
4375
|
}
|
|
4520
4376
|
staticUtility("shadow-none", [
|
|
4521
4377
|
ringShadowProperties,
|
|
@@ -4555,10 +4411,10 @@ for (const layer of ["shadow", "inset-shadow"]) functionalUtility({
|
|
|
4555
4411
|
supportsCustomProperty: true,
|
|
4556
4412
|
supportsOpacity: true,
|
|
4557
4413
|
themeKeys: ["colors"],
|
|
4558
|
-
handleBareValue: ({ value, extra }) => namedBoxShadow(layer, value, extra?.opacity) ? value : null,
|
|
4559
|
-
handle: (value,
|
|
4414
|
+
handleBareValue: ({ value, ctx, extra }) => namedBoxShadow(layer, value, extra?.opacity, ctx) ? value : null,
|
|
4415
|
+
handle: (value, ctx, token, extra) => {
|
|
4560
4416
|
const opacity = extra?.opacity;
|
|
4561
|
-
const named = !
|
|
4417
|
+
const named = !token.arbitrary ? namedBoxShadow(layer, extra?.realThemeValue ?? value, opacity, ctx) : null;
|
|
4562
4418
|
if (named) return named;
|
|
4563
4419
|
const color = layerColor(layer, value, opacity, token, extra?.realThemeValue);
|
|
4564
4420
|
if (color !== void 0) return color;
|
|
@@ -4590,8 +4446,8 @@ functionalUtility({
|
|
|
4590
4446
|
handleBareValue: ({ value, ctx }) => namedTextShadow(ctx, value) ? value : null,
|
|
4591
4447
|
handle: (value, ctx, token, extra) => {
|
|
4592
4448
|
const opacity = extra?.opacity;
|
|
4593
|
-
if (!
|
|
4594
|
-
const named = namedTextShadow(ctx, value);
|
|
4449
|
+
if (!token.arbitrary) {
|
|
4450
|
+
const named = namedTextShadow(ctx, extra?.realThemeValue ?? value);
|
|
4595
4451
|
if (named) return textShadowValue(named, opacity);
|
|
4596
4452
|
}
|
|
4597
4453
|
const color = layerColor("text-shadow", value, opacity, token, extra?.realThemeValue);
|
|
@@ -4632,6 +4488,22 @@ function ringShadowValue(width) {
|
|
|
4632
4488
|
["--baro-ring-offset-shadow", `var(--baro-ring-inset,) 0 0 0 var(--baro-ring-offset-width) var(--baro-ring-offset-color)`]
|
|
4633
4489
|
], { category: "effects" });
|
|
4634
4490
|
});
|
|
4491
|
+
var ringOffsetWidth = (width) => [decl("--baro-ring-offset-width", width), decl("--baro-ring-offset-shadow", "var(--baro-ring-inset,) 0 0 0 var(--baro-ring-offset-width) var(--baro-ring-offset-color)")];
|
|
4492
|
+
functionalUtility({
|
|
4493
|
+
name: "ring-offset",
|
|
4494
|
+
themeKeys: ["ringOffsetWidth", "colors"],
|
|
4495
|
+
supportsArbitrary: true,
|
|
4496
|
+
supportsOpacity: true,
|
|
4497
|
+
handleBareValue: ({ value }) => /^\d+$/.test(value) ? `${value}px` : null,
|
|
4498
|
+
handle: (value, _ctx, token, extra) => {
|
|
4499
|
+
if (extra?.themeNamespace === "ringOffsetWidth") return ringOffsetWidth(value);
|
|
4500
|
+
if (extra?.realThemeValue) return themeColorDecls("--baro-ring-offset-color", value, extra);
|
|
4501
|
+
if (token.arbitrary) return parseColor(value) ? [decl("--baro-ring-offset-color", value)] : parseLength(value) ? ringOffsetWidth(value) : null;
|
|
4502
|
+
if (/^\d+px$/.test(value)) return ringOffsetWidth(value);
|
|
4503
|
+
return null;
|
|
4504
|
+
},
|
|
4505
|
+
category: "effects"
|
|
4506
|
+
});
|
|
4635
4507
|
[
|
|
4636
4508
|
["inset-ring", "1px"],
|
|
4637
4509
|
["inset-ring-0", "0px"],
|
|
@@ -4663,9 +4535,14 @@ functionalUtility({
|
|
|
4663
4535
|
supportsArbitrary: true,
|
|
4664
4536
|
supportsCustomProperty: true,
|
|
4665
4537
|
supportsOpacity: true,
|
|
4666
|
-
themeKeys: ["colors"],
|
|
4538
|
+
themeKeys: ["colors", "ringWidth"],
|
|
4667
4539
|
handle: (value, ctx, token, extra) => {
|
|
4668
4540
|
const main = value;
|
|
4541
|
+
if (extra?.themeNamespace === "ringWidth") return [
|
|
4542
|
+
ringShadowProperties(),
|
|
4543
|
+
decl("--baro-ring-shadow", ringShadowValue(value)),
|
|
4544
|
+
decl("box-shadow", SHADOW_COMPOSITE)
|
|
4545
|
+
];
|
|
4669
4546
|
const opacity = extra?.opacity;
|
|
4670
4547
|
const realThemeValue = extra?.realThemeValue;
|
|
4671
4548
|
if (realThemeValue) return createRingColorDecls("--baro-ring-color", main, opacity, realThemeValue);
|
|
@@ -4961,6 +4838,7 @@ functionalUtility({
|
|
|
4961
4838
|
supportsArbitrary: true,
|
|
4962
4839
|
supportsCustomProperty: true,
|
|
4963
4840
|
supportsFraction: true,
|
|
4841
|
+
handleBareValue: ({ value, ctx }) => themeKeyVar(ctx, "aspect", value, "aspect") ?? (/^(\d|\.\d)/.test(value) ? value : null),
|
|
4964
4842
|
description: "aspect-ratio utility (theme, arbitrary, custom property, fraction supported)",
|
|
4965
4843
|
category: "layout"
|
|
4966
4844
|
});
|
|
@@ -4984,7 +4862,7 @@ functionalUtility({
|
|
|
4984
4862
|
supportsArbitrary: true,
|
|
4985
4863
|
supportsCustomProperty: true,
|
|
4986
4864
|
supportsFraction: true,
|
|
4987
|
-
handleBareValue: ({ value }) => parseNumber(value),
|
|
4865
|
+
handleBareValue: ({ value, ctx }) => parseNumber(value) ?? themeKeyVar(ctx, "container", value, "container"),
|
|
4988
4866
|
description: "columns utility (theme, arbitrary, custom property, fraction supported)",
|
|
4989
4867
|
category: "layout"
|
|
4990
4868
|
});
|
|
@@ -6033,10 +5911,10 @@ functionalUtility({
|
|
|
6033
5911
|
supportsArbitrary: true,
|
|
6034
5912
|
supportsCustomProperty: true,
|
|
6035
5913
|
supportsFraction: true,
|
|
6036
|
-
handleBareValue: ({ value }) => {
|
|
5914
|
+
handleBareValue: ({ value, ctx }) => {
|
|
6037
5915
|
if (parseNumber(value)) return `calc(var(--spacing) * ${value})`;
|
|
6038
5916
|
if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;
|
|
6039
|
-
return
|
|
5917
|
+
return themeKeyVar(ctx, "container", value, "container");
|
|
6040
5918
|
},
|
|
6041
5919
|
description: "max-width utility (spacing, fraction, arbitrary, custom property, static supported)",
|
|
6042
5920
|
category: "sizing"
|
|
@@ -6146,11 +6024,11 @@ functionalUtility({
|
|
|
6146
6024
|
supportsArbitrary: true,
|
|
6147
6025
|
supportsCustomProperty: true,
|
|
6148
6026
|
supportsFraction: true,
|
|
6149
|
-
handleBareValue: ({ value, token }) => {
|
|
6027
|
+
handleBareValue: ({ value, token, ctx }) => {
|
|
6150
6028
|
if (token.negative) return null;
|
|
6151
6029
|
if (parseNumber(value)) return `calc(var(--spacing) * ${value})`;
|
|
6152
6030
|
if (parseFractionOrNumber(value)) return `calc(${value} * 100%)`;
|
|
6153
|
-
return null;
|
|
6031
|
+
return name.includes("inline") ? themeKeyVar(ctx, "container", value, "container") : null;
|
|
6154
6032
|
},
|
|
6155
6033
|
description: `${prop} utility (spacing, fraction, arbitrary, custom property, keywords)`,
|
|
6156
6034
|
category: "sizing"
|
|
@@ -6176,21 +6054,34 @@ staticUtility("text-6xl", [["font-size", "var(--text-6xl)"], ["line-height", "va
|
|
|
6176
6054
|
staticUtility("text-7xl", [["font-size", "var(--text-7xl)"], ["line-height", "var(--baro-leading, var(--text-7xl--line-height))"]], { category: "typography" });
|
|
6177
6055
|
staticUtility("text-8xl", [["font-size", "var(--text-8xl)"], ["line-height", "var(--baro-leading, var(--text-8xl--line-height))"]], { category: "typography" });
|
|
6178
6056
|
staticUtility("text-9xl", [["font-size", "var(--text-9xl)"], ["line-height", "var(--baro-leading, var(--text-9xl--line-height))"]], { category: "typography" });
|
|
6179
|
-
|
|
6180
|
-
|
|
6181
|
-
|
|
6182
|
-
|
|
6183
|
-
|
|
6184
|
-
|
|
6185
|
-
|
|
6186
|
-
|
|
6187
|
-
|
|
6057
|
+
function fontWeightUtility(name) {
|
|
6058
|
+
registerUtility({
|
|
6059
|
+
name: `font-${name}`,
|
|
6060
|
+
match: (className) => className === `font-${name}`,
|
|
6061
|
+
handler: (_value, ctx) => {
|
|
6062
|
+
const family = themeKeyVar(ctx, "fontFamily", name, "font");
|
|
6063
|
+
return family ? [decl("font-family", family)] : [decl("font-weight", `var(--font-weight-${name})`)];
|
|
6064
|
+
},
|
|
6065
|
+
category: "typography"
|
|
6066
|
+
});
|
|
6067
|
+
}
|
|
6068
|
+
fontWeightUtility("thin");
|
|
6069
|
+
fontWeightUtility("extralight");
|
|
6070
|
+
fontWeightUtility("light");
|
|
6071
|
+
fontWeightUtility("normal");
|
|
6072
|
+
fontWeightUtility("medium");
|
|
6073
|
+
fontWeightUtility("semibold");
|
|
6074
|
+
fontWeightUtility("bold");
|
|
6075
|
+
fontWeightUtility("extrabold");
|
|
6076
|
+
fontWeightUtility("black");
|
|
6188
6077
|
functionalUtility({
|
|
6189
6078
|
name: "font",
|
|
6190
6079
|
supportsArbitrary: true,
|
|
6191
6080
|
supportsCustomProperty: true,
|
|
6081
|
+
handleBareValue: ({ value, ctx }) => themeKeyVar(ctx, "fontFamily", value, "font") ?? themeKeyVar(ctx, "fontWeight", value, "font-weight") ?? (/^(\d|\.\d)/.test(value) ? value : null),
|
|
6192
6082
|
handle: (value, _ctx, token) => {
|
|
6193
6083
|
if (token.prefix !== "font") return null;
|
|
6084
|
+
if (!token.arbitrary && value.startsWith("var(--font-weight-")) return [decl("font-weight", value)];
|
|
6194
6085
|
if (parseNumber(value)) return [decl("font-weight", value)];
|
|
6195
6086
|
return [decl("font-family", value)];
|
|
6196
6087
|
},
|
|
@@ -6213,9 +6104,9 @@ staticUtility("tracking-widest", [["letter-spacing", "var(--letter-spacing-wides
|
|
|
6213
6104
|
functionalUtility({
|
|
6214
6105
|
name: "tracking",
|
|
6215
6106
|
prop: "letter-spacing",
|
|
6216
|
-
themeKey: "letterSpacing",
|
|
6217
6107
|
supportsArbitrary: true,
|
|
6218
6108
|
supportsCustomProperty: true,
|
|
6109
|
+
handleBareValue: ({ value, ctx }) => themeKeyVar(ctx, "letterSpacing", value, "letter-spacing") ?? (/^(\d|\.\d)/.test(value) ? value : null),
|
|
6219
6110
|
description: "letter-spacing utility (theme, arbitrary, custom property supported)",
|
|
6220
6111
|
category: "typography"
|
|
6221
6112
|
});
|
|
@@ -6251,11 +6142,14 @@ staticUtility("leading-loose", [
|
|
|
6251
6142
|
], { category: "typography" });
|
|
6252
6143
|
functionalUtility({
|
|
6253
6144
|
name: "leading",
|
|
6254
|
-
prop: "line-height",
|
|
6255
|
-
themeKey: "lineHeight",
|
|
6256
6145
|
supportsArbitrary: true,
|
|
6257
6146
|
supportsCustomProperty: true,
|
|
6258
|
-
handleBareValue: ({ value }) =>
|
|
6147
|
+
handleBareValue: ({ value, ctx }) => {
|
|
6148
|
+
const v = themeKeyValue(ctx, "lineHeight", value);
|
|
6149
|
+
if (v != null) return `var(--leading-${value}, ${v})`;
|
|
6150
|
+
const numbered = ctx.theme("lineHeight", value);
|
|
6151
|
+
return typeof numbered === "string" ? numbered : parseNumber(value);
|
|
6152
|
+
},
|
|
6259
6153
|
handle: (value) => [
|
|
6260
6154
|
decl("--baro-leading", value),
|
|
6261
6155
|
decl("line-height", value),
|
|
@@ -6312,8 +6206,11 @@ functionalUtility({
|
|
|
6312
6206
|
supportsArbitrary: true,
|
|
6313
6207
|
supportsCustomProperty: true,
|
|
6314
6208
|
supportsOpacity: true,
|
|
6209
|
+
handleBareValue: ({ value, ctx, extra }) => (extra?.opacity ? null : themeKeyVar(ctx, "fontSize", value, "text")) ?? (/^(\d|\.\d)/.test(value) ? value : null),
|
|
6315
6210
|
handle: (value, ctx, token, extra) => {
|
|
6316
6211
|
if (extra?.realThemeValue) return themeColorDecls("color", value, extra);
|
|
6212
|
+
const sizeKey = !token.arbitrary && !token.customProperty ? /^var\(--text-([\w-]+)\)$/.exec(value)?.[1] : void 0;
|
|
6213
|
+
if (sizeKey) return fontSizeLineHeight(ctx.theme("fontSize", sizeKey)) ? [decl("font-size", value), decl("line-height", `var(--baro-leading, var(--text-${sizeKey}--line-height))`)] : [decl("font-size", value)];
|
|
6317
6214
|
const kind = textArbitraryKind(value);
|
|
6318
6215
|
return [decl(kind.fontSize ? "font-size" : "color", kind.value)];
|
|
6319
6216
|
},
|
|
@@ -6436,11 +6333,12 @@ functionalUtility({
|
|
|
6436
6333
|
});
|
|
6437
6334
|
functionalUtility({
|
|
6438
6335
|
name: "decoration",
|
|
6439
|
-
|
|
6336
|
+
themeKeys: ["textDecorationThickness", "colors"],
|
|
6440
6337
|
supportsArbitrary: true,
|
|
6441
6338
|
supportsCustomProperty: true,
|
|
6442
6339
|
supportsOpacity: true,
|
|
6443
6340
|
handle: (value, ctx, token, extra) => {
|
|
6341
|
+
if (extra?.themeNamespace === "textDecorationThickness") return [decl("text-decoration-thickness", value)];
|
|
6444
6342
|
if (extra?.realThemeValue) return themeColorDecls("text-decoration-color", value, extra);
|
|
6445
6343
|
return [decl("text-decoration-color", value)];
|
|
6446
6344
|
},
|
|
@@ -6524,7 +6422,7 @@ functionalUtility({
|
|
|
6524
6422
|
prop: "content",
|
|
6525
6423
|
supportsArbitrary: true,
|
|
6526
6424
|
supportsCustomProperty: true,
|
|
6527
|
-
handle: (value) => [decl("--baro-content",
|
|
6425
|
+
handle: (value) => [decl("--baro-content", value), decl("content", "var(--baro-content)")],
|
|
6528
6426
|
handleCustomProperty: (value) => [decl("--baro-content", `var(${value})`), decl("content", "var(--baro-content)")],
|
|
6529
6427
|
description: "content utility (arbitrary, custom property supported)",
|
|
6530
6428
|
category: "typography"
|
|
@@ -6804,7 +6702,20 @@ staticUtility("rounded-2xl", [["border-radius", "var(--radius-2xl)"]], { categor
|
|
|
6804
6702
|
staticUtility("rounded-3xl", [["border-radius", "var(--radius-3xl)"]], { category: "borders" });
|
|
6805
6703
|
staticUtility("rounded-4xl", [["border-radius", "var(--radius-4xl)"]], { category: "borders" });
|
|
6806
6704
|
staticUtility("rounded-xs", [["border-radius", "var(--radius-xs)"]], { category: "borders" });
|
|
6807
|
-
|
|
6705
|
+
var FULL = "calc(infinity * 1px)";
|
|
6706
|
+
function roundedFull(name, props) {
|
|
6707
|
+
registerUtility({
|
|
6708
|
+
name,
|
|
6709
|
+
match: (className) => className === name,
|
|
6710
|
+
handler: (_value, ctx) => {
|
|
6711
|
+
const own = themeKeyValue(ctx, "borderRadius", "full");
|
|
6712
|
+
const value = own != null && own !== "9999px" && own !== FULL ? "var(--radius-full)" : FULL;
|
|
6713
|
+
return props.map((prop) => decl(prop, value));
|
|
6714
|
+
},
|
|
6715
|
+
category: "borders"
|
|
6716
|
+
});
|
|
6717
|
+
}
|
|
6718
|
+
roundedFull("rounded-full", ["border-radius"]);
|
|
6808
6719
|
[
|
|
6809
6720
|
["rounded-t", ["border-top-left-radius", "border-top-right-radius"]],
|
|
6810
6721
|
["rounded-r", ["border-top-right-radius", "border-bottom-right-radius"]],
|
|
@@ -6833,14 +6744,14 @@ staticUtility("rounded-full", [["border-radius", "9999px"]], { category: "border
|
|
|
6833
6744
|
staticUtility(`${name}-3xl`, propList.map((prop) => [prop, "var(--radius-3xl)"]), { category: "borders" });
|
|
6834
6745
|
staticUtility(`${name}-4xl`, propList.map((prop) => [prop, "var(--radius-4xl)"]), { category: "borders" });
|
|
6835
6746
|
staticUtility(`${name}-xs`, propList.map((prop) => [prop, "var(--radius-xs)"]), { category: "borders" });
|
|
6836
|
-
|
|
6747
|
+
roundedFull(`${name}-full`, propList);
|
|
6837
6748
|
functionalUtility({
|
|
6838
6749
|
name,
|
|
6839
6750
|
supportsArbitrary: true,
|
|
6840
6751
|
supportsCustomProperty: true,
|
|
6841
|
-
handleBareValue: ({ value }) => {
|
|
6752
|
+
handleBareValue: ({ value, ctx }) => {
|
|
6842
6753
|
if (!logical && parseNumber(value)) return `calc(var(--spacing) * ${value})`;
|
|
6843
|
-
return
|
|
6754
|
+
return themeKeyVar(ctx, "borderRadius", value, "radius");
|
|
6844
6755
|
},
|
|
6845
6756
|
handle: (value) => propList.map((prop) => decl(prop, value)),
|
|
6846
6757
|
description: `${name} utility (spacing, arbitrary, custom property support)`,
|
|
@@ -6852,9 +6763,9 @@ functionalUtility({
|
|
|
6852
6763
|
handle: (value, _ctx, token) => token.prefix === "rounded" ? [decl("border-radius", value)] : null,
|
|
6853
6764
|
supportsArbitrary: true,
|
|
6854
6765
|
supportsCustomProperty: true,
|
|
6855
|
-
handleBareValue: ({ value }) => {
|
|
6766
|
+
handleBareValue: ({ value, ctx }) => {
|
|
6856
6767
|
if (parseNumber(value)) return `calc(var(--spacing) * ${value})`;
|
|
6857
|
-
return
|
|
6768
|
+
return themeKeyVar(ctx, "borderRadius", value, "radius");
|
|
6858
6769
|
},
|
|
6859
6770
|
description: "border-radius utility (spacing, arbitrary, custom property support)",
|
|
6860
6771
|
category: "borders"
|
|
@@ -6903,7 +6814,7 @@ var withBorderStyle = (props, width) => [
|
|
|
6903
6814
|
staticUtility(`${name}`, styled("1px"));
|
|
6904
6815
|
functionalUtility({
|
|
6905
6816
|
name,
|
|
6906
|
-
themeKeys: ["
|
|
6817
|
+
themeKeys: ["colors", "borderWidth"],
|
|
6907
6818
|
supportsOpacity: true,
|
|
6908
6819
|
supportsArbitrary: true,
|
|
6909
6820
|
supportsCustomProperty: true,
|
|
@@ -6912,6 +6823,7 @@ var withBorderStyle = (props, width) => [
|
|
|
6912
6823
|
return null;
|
|
6913
6824
|
},
|
|
6914
6825
|
handle: (value, ctx, token, extra) => {
|
|
6826
|
+
if (extra?.themeNamespace === "borderWidth") return withBorderStyle(propList, value);
|
|
6915
6827
|
if (extra?.realThemeValue) return propList.flatMap((prop) => themeColorDecls(prop.replace("width", "color"), value, extra));
|
|
6916
6828
|
if (parseColor(value)) return propList.map((prop) => decl(prop.replace("width", "color"), value));
|
|
6917
6829
|
if (token.arbitrary) return withBorderStyle(propList, value);
|
|
@@ -6958,6 +6870,7 @@ Object.entries({
|
|
|
6958
6870
|
staticUtility(`divide-${axis}-reverse`, [rule(":where(& > :not(:last-child))", [decl(rev, "1")])], { category: "borders" });
|
|
6959
6871
|
functionalUtility({
|
|
6960
6872
|
name: `divide-${axis}`,
|
|
6873
|
+
themeKeys: ["divideWidth", "borderWidth"],
|
|
6961
6874
|
supportsArbitrary: true,
|
|
6962
6875
|
handleBareValue: ({ value }) => /^\d+$/.test(value) ? `${value}px` : null,
|
|
6963
6876
|
handle: (value) => divide(value),
|
|
@@ -6972,6 +6885,7 @@ functionalUtility({
|
|
|
6972
6885
|
supportsCustomProperty: true,
|
|
6973
6886
|
supportsOpacity: true,
|
|
6974
6887
|
handle: (value, ctx, token, extra) => {
|
|
6888
|
+
if (extra?.themeNamespace === "borderWidth") return withBorderStyle(["border-width"], value);
|
|
6975
6889
|
if (extra?.realThemeValue) return themeColorDecls("border-color", value, extra);
|
|
6976
6890
|
if (token.arbitrary) {
|
|
6977
6891
|
if (parseLength(value)) return withBorderStyle(["border-width"], value);
|
|
@@ -7048,11 +6962,12 @@ functionalUtility({
|
|
|
7048
6962
|
});
|
|
7049
6963
|
functionalUtility({
|
|
7050
6964
|
name: "outline",
|
|
7051
|
-
themeKeys: ["colors", "
|
|
6965
|
+
themeKeys: ["colors", "outlineWidth"],
|
|
7052
6966
|
supportsArbitrary: true,
|
|
7053
6967
|
supportsCustomProperty: true,
|
|
7054
6968
|
supportsOpacity: true,
|
|
7055
6969
|
handle: (value, ctx, token, extra) => {
|
|
6970
|
+
if (extra?.themeNamespace === "outlineWidth") return withOutlineStyle(value);
|
|
7056
6971
|
if (extra?.realThemeValue) return themeColorDecls("outline-color", value, extra);
|
|
7057
6972
|
if (parseColor(value)) return [decl("outline-color", value)];
|
|
7058
6973
|
if (parseNumber(value)) return withOutlineStyle(`${value}px`);
|
|
@@ -7525,11 +7440,11 @@ staticUtility("stroke-black", [["stroke", "#000"]], { category: "svg" });
|
|
|
7525
7440
|
staticUtility("stroke-white", [["stroke", "#fff"]], { category: "svg" });
|
|
7526
7441
|
functionalUtility({
|
|
7527
7442
|
name: "stroke",
|
|
7528
|
-
themeKeys: ["colors"],
|
|
7443
|
+
themeKeys: ["colors", "strokeWidth"],
|
|
7529
7444
|
supportsArbitrary: true,
|
|
7530
7445
|
supportsCustomProperty: true,
|
|
7531
7446
|
handle: (value, ctx, token, extra) => {
|
|
7532
|
-
if (parseNumber(value)) return [decl("stroke-width", value)];
|
|
7447
|
+
if (parseNumber(value) || extra?.themeNamespace === "strokeWidth") return [decl("stroke-width", value)];
|
|
7533
7448
|
if (extra?.realThemeValue) return [decl("stroke", `var(--color-${extra.realThemeValue})`)];
|
|
7534
7449
|
return [decl("stroke", value)];
|
|
7535
7450
|
},
|
|
@@ -7685,7 +7600,7 @@ staticModifier("open", ["&:is([open], :popover-open, :open)"], {
|
|
|
7685
7600
|
var withPseudoContent = (ast) => [
|
|
7686
7601
|
atRoot([property("--baro-content", "\"\"")]),
|
|
7687
7602
|
...ast,
|
|
7688
|
-
decl("content", "var(--baro-content)")
|
|
7603
|
+
...ast.some((n) => n.type === "decl" && n.prop === "content") ? [] : [decl("content", "var(--baro-content)")]
|
|
7689
7604
|
];
|
|
7690
7605
|
staticModifier("before", ["&::before"], {
|
|
7691
7606
|
source: "pseudo",
|
|
@@ -8499,6 +8414,8 @@ exports.staticModifier = staticModifier;
|
|
|
8499
8414
|
exports.staticUtility = staticUtility;
|
|
8500
8415
|
exports.styleRule = styleRule;
|
|
8501
8416
|
exports.themeGetter = themeGetter;
|
|
8417
|
+
exports.themeKeyValue = themeKeyValue;
|
|
8418
|
+
exports.themeKeyVar = themeKeyVar;
|
|
8502
8419
|
exports.themeToCssVars = themeToCssVars;
|
|
8503
8420
|
exports.tokenize = tokenize;
|
|
8504
8421
|
exports.upperBound = upperBound;
|