meno-core 1.1.0 → 1.1.1
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/chunks/{chunk-NUP7H7D3.js → chunk-7ZLF4NE5.js} +2 -2
- package/dist/chunks/{chunk-2IIQK7T3.js → chunk-J4IPTP5X.js} +393 -3
- package/dist/chunks/{chunk-2IIQK7T3.js.map → chunk-J4IPTP5X.js.map} +3 -3
- package/dist/lib/client/index.js +2 -2
- package/dist/lib/server/index.js +14 -5
- package/dist/lib/server/index.js.map +2 -2
- package/dist/lib/shared/index.js +5 -1
- package/dist/lib/shared/index.js.map +2 -2
- package/lib/server/ssr/htmlGenerator.ts +18 -2
- package/lib/server/ssr/ssrRenderer.test.ts +25 -0
- package/lib/server/ssr/ssrRenderer.ts +12 -2
- package/lib/shared/cssGeneration.test.ts +10 -0
- package/lib/shared/cssGeneration.ts +10 -8
- package/lib/shared/index.ts +6 -0
- package/lib/shared/interactiveStyles.test.ts +3 -1
- package/lib/shared/tailwindThemeScale.ts +256 -0
- package/lib/shared/utilityClassConfig.ts +116 -0
- package/lib/shared/utilityClassMapper.test.ts +148 -0
- package/lib/shared/utilityClassMapper.ts +33 -0
- package/lib/shared/utilityClassNames.ts +146 -0
- package/package.json +1 -1
- /package/dist/chunks/{chunk-NUP7H7D3.js.map → chunk-7ZLF4NE5.js.map} +0 -0
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
normalizeStyle,
|
|
17
17
|
richTextMarkerToHtml,
|
|
18
18
|
safeEvaluate
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-J4IPTP5X.js";
|
|
20
20
|
import {
|
|
21
21
|
NODE_TYPE,
|
|
22
22
|
RAW_HTML_PREFIX,
|
|
@@ -805,4 +805,4 @@ export {
|
|
|
805
805
|
skipEmptyTemplateAttributes,
|
|
806
806
|
inlineSvgStyleRules
|
|
807
807
|
};
|
|
808
|
-
//# sourceMappingURL=chunk-
|
|
808
|
+
//# sourceMappingURL=chunk-7ZLF4NE5.js.map
|
|
@@ -3725,6 +3725,9 @@ var propertyOrder = [
|
|
|
3725
3725
|
// Transform & Effects
|
|
3726
3726
|
"opacity",
|
|
3727
3727
|
"transform",
|
|
3728
|
+
"translate",
|
|
3729
|
+
"rotate",
|
|
3730
|
+
"scale",
|
|
3728
3731
|
"transformOrigin",
|
|
3729
3732
|
"boxShadow",
|
|
3730
3733
|
"textShadow",
|
|
@@ -3740,6 +3743,8 @@ var propertyOrder = [
|
|
|
3740
3743
|
"bottom",
|
|
3741
3744
|
"left",
|
|
3742
3745
|
"inset",
|
|
3746
|
+
"insetInline",
|
|
3747
|
+
"insetBlock",
|
|
3743
3748
|
"zIndex",
|
|
3744
3749
|
// Grid Layout
|
|
3745
3750
|
"gridTemplateColumns",
|
|
@@ -3748,7 +3753,11 @@ var propertyOrder = [
|
|
|
3748
3753
|
"gridGap",
|
|
3749
3754
|
"gridAutoFlow",
|
|
3750
3755
|
"gridColumn",
|
|
3756
|
+
"gridColumnStart",
|
|
3757
|
+
"gridColumnEnd",
|
|
3751
3758
|
"gridRow",
|
|
3759
|
+
"gridRowStart",
|
|
3760
|
+
"gridRowEnd",
|
|
3752
3761
|
"gridArea",
|
|
3753
3762
|
"gridAutoRows",
|
|
3754
3763
|
"gridAutoColumns",
|
|
@@ -3777,6 +3786,10 @@ var propertyOrder = [
|
|
|
3777
3786
|
"pointerEvents",
|
|
3778
3787
|
"userSelect",
|
|
3779
3788
|
"transition",
|
|
3789
|
+
"transitionProperty",
|
|
3790
|
+
"transitionDuration",
|
|
3791
|
+
"transitionTimingFunction",
|
|
3792
|
+
"transitionDelay",
|
|
3780
3793
|
"objectFit",
|
|
3781
3794
|
"objectPosition",
|
|
3782
3795
|
"boxSizing",
|
|
@@ -3903,6 +3916,8 @@ var prefixToCSSProperty = {
|
|
|
3903
3916
|
// Sizing
|
|
3904
3917
|
w: "width",
|
|
3905
3918
|
h: "height",
|
|
3919
|
+
size: "width",
|
|
3920
|
+
// multi-prop (width + height) — expanded in generateRuleForClass / classesToStyles
|
|
3906
3921
|
"max-w": "max-width",
|
|
3907
3922
|
"max-h": "max-height",
|
|
3908
3923
|
"min-w": "min-width",
|
|
@@ -3941,13 +3956,27 @@ var prefixToCSSProperty = {
|
|
|
3941
3956
|
"grid-cols": "grid-template-columns",
|
|
3942
3957
|
"grid-rows": "grid-template-rows",
|
|
3943
3958
|
col: "grid-column",
|
|
3959
|
+
"col-span": "grid-column",
|
|
3960
|
+
"col-start": "grid-column-start",
|
|
3961
|
+
"col-end": "grid-column-end",
|
|
3944
3962
|
row: "grid-row",
|
|
3963
|
+
"row-span": "grid-row",
|
|
3964
|
+
"row-start": "grid-row-start",
|
|
3965
|
+
"row-end": "grid-row-end",
|
|
3945
3966
|
"auto-rows": "grid-auto-rows",
|
|
3946
3967
|
"auto-cols": "grid-auto-columns",
|
|
3947
3968
|
// Effects
|
|
3948
3969
|
opacity: "opacity",
|
|
3949
3970
|
transform: "transform",
|
|
3971
|
+
scale: "scale",
|
|
3972
|
+
rotate: "rotate",
|
|
3973
|
+
"translate-x": "translate",
|
|
3974
|
+
"translate-y": "translate",
|
|
3950
3975
|
origin: "transform-origin",
|
|
3976
|
+
// Transitions (each maps to a distinct longhand → compose across classes)
|
|
3977
|
+
duration: "transition-duration",
|
|
3978
|
+
delay: "transition-delay",
|
|
3979
|
+
ease: "transition-timing-function",
|
|
3951
3980
|
shadow: "box-shadow",
|
|
3952
3981
|
"text-shadow": "text-shadow",
|
|
3953
3982
|
filter: "filter",
|
|
@@ -3958,6 +3987,8 @@ var prefixToCSSProperty = {
|
|
|
3958
3987
|
bottom: "bottom",
|
|
3959
3988
|
left: "left",
|
|
3960
3989
|
inset: "inset",
|
|
3990
|
+
"inset-x": "inset-inline",
|
|
3991
|
+
"inset-y": "inset-block",
|
|
3961
3992
|
z: "z-index",
|
|
3962
3993
|
// Outline
|
|
3963
3994
|
outline: "outline",
|
|
@@ -4315,8 +4346,11 @@ var SPACING_SCALE_ROOTS = /* @__PURE__ */ new Set([
|
|
|
4315
4346
|
"bottom",
|
|
4316
4347
|
"left",
|
|
4317
4348
|
"inset",
|
|
4349
|
+
"inset-x",
|
|
4350
|
+
"inset-y",
|
|
4318
4351
|
"w",
|
|
4319
4352
|
"h",
|
|
4353
|
+
"size",
|
|
4320
4354
|
"min-w",
|
|
4321
4355
|
"min-h",
|
|
4322
4356
|
"max-w",
|
|
@@ -4340,6 +4374,7 @@ var keywordValues = {
|
|
|
4340
4374
|
h: { auto: "auto", full: "100%", screen: "100vh", fit: "fit-content", min: "min-content", max: "max-content" },
|
|
4341
4375
|
"max-w": { full: "100%", none: "none", screen: "100vw", fit: "fit-content", min: "min-content", max: "max-content" },
|
|
4342
4376
|
"max-h": { full: "100%", none: "none", screen: "100vh", fit: "fit-content", min: "min-content", max: "max-content" },
|
|
4377
|
+
size: { auto: "auto", full: "100%", fit: "fit-content", min: "min-content", max: "max-content" },
|
|
4343
4378
|
"min-w": { auto: "auto", full: "100%", fit: "fit-content", min: "min-content", max: "max-content" },
|
|
4344
4379
|
"min-h": { auto: "auto", full: "100%", screen: "100vh", fit: "fit-content", min: "min-content", max: "max-content" },
|
|
4345
4380
|
m: { auto: "auto" },
|
|
@@ -4362,7 +4397,11 @@ var keywordValues = {
|
|
|
4362
4397
|
"rounded-br": { none: "0", full: "9999px" },
|
|
4363
4398
|
z: { auto: "auto" },
|
|
4364
4399
|
leading: { normal: "normal" },
|
|
4365
|
-
tracking: { normal: "normal" }
|
|
4400
|
+
tracking: { normal: "normal" },
|
|
4401
|
+
"inset-x": { auto: "auto", full: "100%" },
|
|
4402
|
+
"inset-y": { auto: "auto", full: "100%" },
|
|
4403
|
+
aspect: { auto: "auto", square: "1 / 1", video: "16 / 9" },
|
|
4404
|
+
order: { first: "-9999", last: "9999", none: "0" }
|
|
4366
4405
|
};
|
|
4367
4406
|
var genericKeywordRoots = /* @__PURE__ */ new Set(["cursor", "align", "origin", "object", "list"]);
|
|
4368
4407
|
var integerValueRoots = /* @__PURE__ */ new Set(["z", "order", "flex", "grow", "shrink"]);
|
|
@@ -4373,6 +4412,60 @@ var colorTokenProps = /* @__PURE__ */ new Set([
|
|
|
4373
4412
|
"accentColor",
|
|
4374
4413
|
"outlineColor"
|
|
4375
4414
|
]);
|
|
4415
|
+
var FRACTION_ROOTS = /* @__PURE__ */ new Set([
|
|
4416
|
+
"w",
|
|
4417
|
+
"h",
|
|
4418
|
+
"size",
|
|
4419
|
+
"min-w",
|
|
4420
|
+
"min-h",
|
|
4421
|
+
"max-w",
|
|
4422
|
+
"max-h",
|
|
4423
|
+
"basis",
|
|
4424
|
+
"top",
|
|
4425
|
+
"right",
|
|
4426
|
+
"bottom",
|
|
4427
|
+
"left",
|
|
4428
|
+
"inset",
|
|
4429
|
+
"inset-x",
|
|
4430
|
+
"inset-y",
|
|
4431
|
+
"translate-x",
|
|
4432
|
+
"translate-y"
|
|
4433
|
+
]);
|
|
4434
|
+
var NEGATABLE_ROOTS = /* @__PURE__ */ new Set([
|
|
4435
|
+
"m",
|
|
4436
|
+
"mt",
|
|
4437
|
+
"mr",
|
|
4438
|
+
"mb",
|
|
4439
|
+
"ml",
|
|
4440
|
+
"mx",
|
|
4441
|
+
"my",
|
|
4442
|
+
"top",
|
|
4443
|
+
"right",
|
|
4444
|
+
"bottom",
|
|
4445
|
+
"left",
|
|
4446
|
+
"inset",
|
|
4447
|
+
"inset-x",
|
|
4448
|
+
"inset-y",
|
|
4449
|
+
"translate-x",
|
|
4450
|
+
"translate-y",
|
|
4451
|
+
"rotate"
|
|
4452
|
+
]);
|
|
4453
|
+
var EASE_TIMING = {
|
|
4454
|
+
linear: "linear",
|
|
4455
|
+
in: "cubic-bezier(0.4, 0, 1, 1)",
|
|
4456
|
+
out: "cubic-bezier(0, 0, 0.2, 1)",
|
|
4457
|
+
"in-out": "cubic-bezier(0.4, 0, 0.2, 1)",
|
|
4458
|
+
initial: "initial"
|
|
4459
|
+
};
|
|
4460
|
+
var TRANSITION_PROPERTY_VALUES = {
|
|
4461
|
+
"": "color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",
|
|
4462
|
+
all: "all",
|
|
4463
|
+
colors: "color, background-color, border-color, text-decoration-color, fill, stroke",
|
|
4464
|
+
opacity: "opacity",
|
|
4465
|
+
shadow: "box-shadow",
|
|
4466
|
+
transform: "transform, translate, scale, rotate"
|
|
4467
|
+
};
|
|
4468
|
+
var TRANSITION_DEFAULT_TIMING = "150ms cubic-bezier(0.4, 0, 0.2, 1)";
|
|
4376
4469
|
var shadowPresets = {
|
|
4377
4470
|
"0": "none",
|
|
4378
4471
|
"1": "0 1px 2px rgba(0, 0, 0, 0.05)",
|
|
@@ -4566,6 +4659,186 @@ function isCssNamedColor(value) {
|
|
|
4566
4659
|
return CSS_NAMED_COLORS.has(value.toLowerCase());
|
|
4567
4660
|
}
|
|
4568
4661
|
|
|
4662
|
+
// lib/shared/tailwindThemeScale.ts
|
|
4663
|
+
var SANS = "ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif";
|
|
4664
|
+
var SERIF = "ui-serif, Georgia, Cambria, serif";
|
|
4665
|
+
var MONO = "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace";
|
|
4666
|
+
var SPECS = [
|
|
4667
|
+
{
|
|
4668
|
+
root: "text",
|
|
4669
|
+
property: "font-size",
|
|
4670
|
+
group: "font-size",
|
|
4671
|
+
varPrefix: "text",
|
|
4672
|
+
labelPrefix: "Text",
|
|
4673
|
+
values: [
|
|
4674
|
+
["xs", "0.75rem"],
|
|
4675
|
+
["sm", "0.875rem"],
|
|
4676
|
+
["base", "1rem"],
|
|
4677
|
+
["lg", "1.125rem"],
|
|
4678
|
+
["xl", "1.25rem"],
|
|
4679
|
+
["2xl", "1.5rem"],
|
|
4680
|
+
["3xl", "1.875rem"],
|
|
4681
|
+
["4xl", "2.25rem"],
|
|
4682
|
+
["5xl", "3rem"],
|
|
4683
|
+
["6xl", "3.75rem"],
|
|
4684
|
+
["7xl", "4.5rem"],
|
|
4685
|
+
["8xl", "6rem"],
|
|
4686
|
+
["9xl", "8rem"]
|
|
4687
|
+
]
|
|
4688
|
+
},
|
|
4689
|
+
{
|
|
4690
|
+
// Only the weights Meno's static utilities don't already cover (normal/bold stay static).
|
|
4691
|
+
root: "font",
|
|
4692
|
+
property: "font-weight",
|
|
4693
|
+
group: "font-weight",
|
|
4694
|
+
varPrefix: "font-weight",
|
|
4695
|
+
labelPrefix: "Font Weight",
|
|
4696
|
+
values: [
|
|
4697
|
+
["thin", "100"],
|
|
4698
|
+
["extralight", "200"],
|
|
4699
|
+
["light", "300"],
|
|
4700
|
+
["medium", "500"],
|
|
4701
|
+
["semibold", "600"],
|
|
4702
|
+
["extrabold", "800"],
|
|
4703
|
+
["black", "900"]
|
|
4704
|
+
]
|
|
4705
|
+
},
|
|
4706
|
+
{
|
|
4707
|
+
root: "font",
|
|
4708
|
+
property: "font-family",
|
|
4709
|
+
group: "font-family",
|
|
4710
|
+
varPrefix: "font",
|
|
4711
|
+
labelPrefix: "Font",
|
|
4712
|
+
values: [
|
|
4713
|
+
["sans", SANS],
|
|
4714
|
+
["serif", SERIF],
|
|
4715
|
+
["mono", MONO]
|
|
4716
|
+
]
|
|
4717
|
+
},
|
|
4718
|
+
{
|
|
4719
|
+
root: "rounded",
|
|
4720
|
+
property: "border-radius",
|
|
4721
|
+
group: "border-radius",
|
|
4722
|
+
varPrefix: "radius",
|
|
4723
|
+
labelPrefix: "Radius",
|
|
4724
|
+
values: [
|
|
4725
|
+
["", "0.25rem"],
|
|
4726
|
+
["sm", "0.125rem"],
|
|
4727
|
+
["md", "0.375rem"],
|
|
4728
|
+
["lg", "0.5rem"],
|
|
4729
|
+
["xl", "0.75rem"],
|
|
4730
|
+
["2xl", "1rem"],
|
|
4731
|
+
["3xl", "1.5rem"]
|
|
4732
|
+
]
|
|
4733
|
+
},
|
|
4734
|
+
{
|
|
4735
|
+
root: "shadow",
|
|
4736
|
+
property: "box-shadow",
|
|
4737
|
+
group: "shadow",
|
|
4738
|
+
varPrefix: "shadow",
|
|
4739
|
+
labelPrefix: "Shadow",
|
|
4740
|
+
values: [
|
|
4741
|
+
["", "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)"],
|
|
4742
|
+
["sm", "0 1px 2px 0 rgb(0 0 0 / 0.05)"],
|
|
4743
|
+
["md", "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"],
|
|
4744
|
+
["lg", "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)"],
|
|
4745
|
+
["xl", "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)"],
|
|
4746
|
+
["2xl", "0 25px 50px -12px rgb(0 0 0 / 0.25)"]
|
|
4747
|
+
]
|
|
4748
|
+
},
|
|
4749
|
+
{
|
|
4750
|
+
root: "max-w",
|
|
4751
|
+
property: "max-width",
|
|
4752
|
+
group: "size",
|
|
4753
|
+
varPrefix: "container",
|
|
4754
|
+
labelPrefix: "Container",
|
|
4755
|
+
values: [
|
|
4756
|
+
["xs", "20rem"],
|
|
4757
|
+
["sm", "24rem"],
|
|
4758
|
+
["md", "28rem"],
|
|
4759
|
+
["lg", "32rem"],
|
|
4760
|
+
["xl", "36rem"],
|
|
4761
|
+
["2xl", "42rem"],
|
|
4762
|
+
["3xl", "48rem"],
|
|
4763
|
+
["4xl", "56rem"],
|
|
4764
|
+
["5xl", "64rem"],
|
|
4765
|
+
["6xl", "72rem"],
|
|
4766
|
+
["7xl", "80rem"],
|
|
4767
|
+
["prose", "65ch"]
|
|
4768
|
+
]
|
|
4769
|
+
},
|
|
4770
|
+
{
|
|
4771
|
+
root: "leading",
|
|
4772
|
+
property: "line-height",
|
|
4773
|
+
group: "line-height",
|
|
4774
|
+
varPrefix: "leading",
|
|
4775
|
+
labelPrefix: "Leading",
|
|
4776
|
+
values: [
|
|
4777
|
+
["none", "1"],
|
|
4778
|
+
["tight", "1.25"],
|
|
4779
|
+
["snug", "1.375"],
|
|
4780
|
+
["relaxed", "1.625"],
|
|
4781
|
+
["loose", "2"]
|
|
4782
|
+
]
|
|
4783
|
+
},
|
|
4784
|
+
{
|
|
4785
|
+
root: "tracking",
|
|
4786
|
+
property: "letter-spacing",
|
|
4787
|
+
group: "letter-spacing",
|
|
4788
|
+
varPrefix: "tracking",
|
|
4789
|
+
labelPrefix: "Tracking",
|
|
4790
|
+
values: [
|
|
4791
|
+
["tighter", "-0.05em"],
|
|
4792
|
+
["tight", "-0.025em"],
|
|
4793
|
+
["wide", "0.025em"],
|
|
4794
|
+
["wider", "0.05em"],
|
|
4795
|
+
["widest", "0.1em"]
|
|
4796
|
+
]
|
|
4797
|
+
}
|
|
4798
|
+
];
|
|
4799
|
+
function labelSuffix(suffix) {
|
|
4800
|
+
if (/^(xs|sm|md|lg|xl|\dxl)$/.test(suffix)) return suffix.toUpperCase();
|
|
4801
|
+
return suffix.charAt(0).toUpperCase() + suffix.slice(1);
|
|
4802
|
+
}
|
|
4803
|
+
var THEME_SCALE_ENTRIES = SPECS.flatMap(
|
|
4804
|
+
(spec) => spec.values.map(([suffix, value]) => {
|
|
4805
|
+
const className = suffix ? `${spec.root}-${suffix}` : spec.root;
|
|
4806
|
+
const cssVar = suffix ? `--${spec.varPrefix}-${suffix}` : `--${spec.varPrefix}`;
|
|
4807
|
+
const label = suffix ? `${spec.labelPrefix} ${labelSuffix(suffix)}` : spec.labelPrefix;
|
|
4808
|
+
return { className, root: spec.root, cssVar, property: spec.property, value, group: spec.group, label };
|
|
4809
|
+
})
|
|
4810
|
+
);
|
|
4811
|
+
var THEME_SCALE_BY_CLASS = new Map(
|
|
4812
|
+
THEME_SCALE_ENTRIES.map((e) => [e.className, e])
|
|
4813
|
+
);
|
|
4814
|
+
var THEME_SCALE_BY_CSSVAR = new Map(
|
|
4815
|
+
THEME_SCALE_ENTRIES.map((e) => [e.cssVar, e])
|
|
4816
|
+
);
|
|
4817
|
+
function themeScaleValue(entry) {
|
|
4818
|
+
return `var(${entry.cssVar})`;
|
|
4819
|
+
}
|
|
4820
|
+
function scalingTypeFor(group) {
|
|
4821
|
+
switch (group) {
|
|
4822
|
+
case "font-size":
|
|
4823
|
+
return "fontSize";
|
|
4824
|
+
case "border-radius":
|
|
4825
|
+
return "borderRadius";
|
|
4826
|
+
case "size":
|
|
4827
|
+
return "size";
|
|
4828
|
+
default:
|
|
4829
|
+
return "none";
|
|
4830
|
+
}
|
|
4831
|
+
}
|
|
4832
|
+
function defaultTailwindThemeVariables() {
|
|
4833
|
+
return THEME_SCALE_ENTRIES.map((e) => ({
|
|
4834
|
+
name: e.label,
|
|
4835
|
+
cssVar: e.cssVar,
|
|
4836
|
+
value: e.value,
|
|
4837
|
+
type: scalingTypeFor(e.group),
|
|
4838
|
+
group: e.group
|
|
4839
|
+
}));
|
|
4840
|
+
}
|
|
4841
|
+
|
|
4569
4842
|
// lib/shared/utilityClassNames.ts
|
|
4570
4843
|
var SORTED_ROOTS = Object.keys(prefixToCSSProperty).sort((a, b) => b.length - a.length);
|
|
4571
4844
|
function camelToKebab(prop) {
|
|
@@ -4729,15 +5002,56 @@ function normalizeBreakpointVariant(variant) {
|
|
|
4729
5002
|
return variant;
|
|
4730
5003
|
}
|
|
4731
5004
|
var HASH_VALUE_RE = /^h[0-9a-z]+$/;
|
|
5005
|
+
function resolveFraction(rest) {
|
|
5006
|
+
const m = rest.match(/^(\d+)\/(\d+)$/);
|
|
5007
|
+
if (!m) return null;
|
|
5008
|
+
const d = Number(m[2]);
|
|
5009
|
+
if (d === 0) return null;
|
|
5010
|
+
const pct = Number(m[1]) / d * 100;
|
|
5011
|
+
return `${pct.toFixed(6).replace(/\.?0+$/, "")}%`;
|
|
5012
|
+
}
|
|
5013
|
+
function resolveSpacingOrFraction(rest) {
|
|
5014
|
+
const frac = resolveFraction(rest);
|
|
5015
|
+
if (frac != null) return frac;
|
|
5016
|
+
if (rest === "full") return "100%";
|
|
5017
|
+
return SPACING_SCALE[rest] ?? null;
|
|
5018
|
+
}
|
|
5019
|
+
function negateCssValue(root, value) {
|
|
5020
|
+
if (root === "translate-y") {
|
|
5021
|
+
const m = value.match(/^0 (.+)$/);
|
|
5022
|
+
return m ? `0 -${m[1]}` : null;
|
|
5023
|
+
}
|
|
5024
|
+
return /^\d/.test(value) ? `-${value}` : null;
|
|
5025
|
+
}
|
|
4732
5026
|
function parseUtilityClass(className, knownTokens) {
|
|
4733
5027
|
const stat = staticUtilityReverse[className];
|
|
4734
5028
|
if (stat) {
|
|
4735
5029
|
return { property: camelToKebab(stat.prop), value: stat.value, root: null, kind: "static" };
|
|
4736
5030
|
}
|
|
5031
|
+
if (className === "transition") {
|
|
5032
|
+
return {
|
|
5033
|
+
property: "transition",
|
|
5034
|
+
value: `${TRANSITION_PROPERTY_VALUES[""]} ${TRANSITION_DEFAULT_TIMING}`,
|
|
5035
|
+
root: "transition",
|
|
5036
|
+
kind: "keyword"
|
|
5037
|
+
};
|
|
5038
|
+
}
|
|
5039
|
+
if (className.startsWith("-") && className.length > 1) {
|
|
5040
|
+
const positive = parseUtilityClass(className.slice(1), knownTokens);
|
|
5041
|
+
if (positive?.root && positive.value != null && NEGATABLE_ROOTS.has(positive.root)) {
|
|
5042
|
+
const negated = negateCssValue(positive.root, positive.value);
|
|
5043
|
+
if (negated != null) return { ...positive, value: negated };
|
|
5044
|
+
}
|
|
5045
|
+
return null;
|
|
5046
|
+
}
|
|
4737
5047
|
const preset = presetClassReverse[className];
|
|
4738
5048
|
if (preset) {
|
|
4739
5049
|
return { property: camelToKebab(preset.prop), value: preset.value, root: null, kind: "preset" };
|
|
4740
5050
|
}
|
|
5051
|
+
const themed = THEME_SCALE_BY_CLASS.get(className);
|
|
5052
|
+
if (themed) {
|
|
5053
|
+
return { property: themed.property, value: themeScaleValue(themed), root: themed.root, kind: "var" };
|
|
5054
|
+
}
|
|
4741
5055
|
const arbProp = className.match(/^\[([a-z-]+):(.+)\]$/);
|
|
4742
5056
|
if (arbProp) {
|
|
4743
5057
|
return {
|
|
@@ -4782,6 +5096,59 @@ function parseRootValue(root, rest, knownTokens) {
|
|
|
4782
5096
|
if (genericKeywordRoots.has(root) && /^[a-z][a-z-]*$/.test(rest)) {
|
|
4783
5097
|
return { property: resolveRootProperty(root, rest), value: rest, root, kind: "keyword" };
|
|
4784
5098
|
}
|
|
5099
|
+
if (root === "grid-cols" || root === "grid-rows") {
|
|
5100
|
+
if (/^[1-9]\d*$/.test(rest)) {
|
|
5101
|
+
const value = `repeat(${rest}, minmax(0, 1fr))`;
|
|
5102
|
+
return { property: prefixToCSSProperty[root] ?? root, value, root, kind: "numeric" };
|
|
5103
|
+
}
|
|
5104
|
+
if (rest === "none" || rest === "subgrid") {
|
|
5105
|
+
return { property: prefixToCSSProperty[root] ?? root, value: rest, root, kind: "keyword" };
|
|
5106
|
+
}
|
|
5107
|
+
}
|
|
5108
|
+
if (root === "col-span" || root === "row-span") {
|
|
5109
|
+
const property = root === "col-span" ? "grid-column" : "grid-row";
|
|
5110
|
+
if (rest === "full") return { property, value: "1 / -1", root, kind: "keyword" };
|
|
5111
|
+
if (/^[1-9]\d*$/.test(rest)) return { property, value: `span ${rest} / span ${rest}`, root, kind: "numeric" };
|
|
5112
|
+
}
|
|
5113
|
+
if (root === "col-start" || root === "col-end" || root === "row-start" || root === "row-end") {
|
|
5114
|
+
const property = prefixToCSSProperty[root] ?? root;
|
|
5115
|
+
if (rest === "auto") return { property, value: "auto", root, kind: "keyword" };
|
|
5116
|
+
if (/^-?[1-9]\d*$/.test(rest)) return { property, value: rest, root, kind: "numeric" };
|
|
5117
|
+
}
|
|
5118
|
+
if (root === "translate-x" || root === "translate-y") {
|
|
5119
|
+
const len = resolveSpacingOrFraction(rest);
|
|
5120
|
+
if (len != null) {
|
|
5121
|
+
const value = root === "translate-x" ? len : `0 ${len}`;
|
|
5122
|
+
return { property: "translate", value, root, kind: "numeric" };
|
|
5123
|
+
}
|
|
5124
|
+
}
|
|
5125
|
+
if (root === "scale" && /^\d+$/.test(rest)) {
|
|
5126
|
+
return { property: "scale", value: String(Number(rest) / 100), root, kind: "numeric" };
|
|
5127
|
+
}
|
|
5128
|
+
if (root === "rotate" && /^\d+(\.\d+)?$/.test(rest)) {
|
|
5129
|
+
return { property: "rotate", value: `${rest}deg`, root, kind: "numeric" };
|
|
5130
|
+
}
|
|
5131
|
+
if ((root === "duration" || root === "delay") && /^\d+$/.test(rest)) {
|
|
5132
|
+
return { property: prefixToCSSProperty[root] ?? root, value: `${rest}ms`, root, kind: "numeric" };
|
|
5133
|
+
}
|
|
5134
|
+
if (root === "ease") {
|
|
5135
|
+
const timing = EASE_TIMING[rest];
|
|
5136
|
+
if (timing) return { property: "transition-timing-function", value: timing, root, kind: "keyword" };
|
|
5137
|
+
}
|
|
5138
|
+
if (root === "transition") {
|
|
5139
|
+
const props = TRANSITION_PROPERTY_VALUES[rest];
|
|
5140
|
+
if (props !== void 0) {
|
|
5141
|
+
return { property: "transition", value: `${props} ${TRANSITION_DEFAULT_TIMING}`, root, kind: "keyword" };
|
|
5142
|
+
}
|
|
5143
|
+
}
|
|
5144
|
+
if (root === "leading") {
|
|
5145
|
+
const scale = SPACING_SCALE[rest];
|
|
5146
|
+
if (scale !== void 0) return { property: "line-height", value: scale, root, kind: "keyword" };
|
|
5147
|
+
}
|
|
5148
|
+
if (FRACTION_ROOTS.has(root)) {
|
|
5149
|
+
const value = resolveFraction(rest);
|
|
5150
|
+
if (value != null) return { property: resolveRootProperty(root, value), value, root, kind: "numeric" };
|
|
5151
|
+
}
|
|
4785
5152
|
if (SPACING_SCALE_ROOTS.has(root)) {
|
|
4786
5153
|
const scaleVal = SPACING_SCALE[rest];
|
|
4787
5154
|
if (scaleVal !== void 0) {
|
|
@@ -4873,6 +5240,13 @@ function rootFormMisresolves(root, prop, value) {
|
|
|
4873
5240
|
}
|
|
4874
5241
|
function propertyValueToClass(prop, value) {
|
|
4875
5242
|
let stringValue = String(value);
|
|
5243
|
+
const varRef = stringValue.match(/^var\((--[\w-]+)(?:\s*,[\s\S]*)?\)$/);
|
|
5244
|
+
if (varRef) {
|
|
5245
|
+
const entry = THEME_SCALE_BY_CSSVAR.get(varRef[1] ?? "");
|
|
5246
|
+
if (entry && entry.property === camelToKebab(prop)) {
|
|
5247
|
+
return entry.className;
|
|
5248
|
+
}
|
|
5249
|
+
}
|
|
4876
5250
|
if (prop === "fontFamily") {
|
|
4877
5251
|
stringValue = stringValue.split(",").map((font) => {
|
|
4878
5252
|
const trimmed = font.trim();
|
|
@@ -4944,6 +5318,14 @@ function propertyValueToClass(prop, value) {
|
|
|
4944
5318
|
className = `${root}-${step}`;
|
|
4945
5319
|
}
|
|
4946
5320
|
}
|
|
5321
|
+
if (!className && (root === "grid-cols" || root === "grid-rows")) {
|
|
5322
|
+
const repeatMatch = stringValue.match(/^repeat\(\s*([1-9]\d*)\s*,\s*minmax\(\s*0\s*,\s*1fr\s*\)\s*\)$/);
|
|
5323
|
+
if (repeatMatch) {
|
|
5324
|
+
className = `${root}-${repeatMatch[1]}`;
|
|
5325
|
+
} else if (stringValue === "none" || stringValue === "subgrid") {
|
|
5326
|
+
className = `${root}-${stringValue}`;
|
|
5327
|
+
}
|
|
5328
|
+
}
|
|
4947
5329
|
if (!className) {
|
|
4948
5330
|
const varMatch = stringValue.match(/^var\((--[\w-]+)\)$/);
|
|
4949
5331
|
if (varMatch) {
|
|
@@ -5120,6 +5502,9 @@ function classesToStyles(classes, knownTokens) {
|
|
|
5120
5502
|
styles[breakpoint] = {};
|
|
5121
5503
|
}
|
|
5122
5504
|
styles[breakpoint][styleEntry.prop] = styleEntry.value;
|
|
5505
|
+
if (cleanClass.startsWith("size-") && styleEntry.prop === "width") {
|
|
5506
|
+
styles[breakpoint].height = styleEntry.value;
|
|
5507
|
+
}
|
|
5123
5508
|
}
|
|
5124
5509
|
}
|
|
5125
5510
|
if (Object.keys(styles.tablet || {}).length === 0) delete styles.tablet;
|
|
@@ -5820,6 +6205,9 @@ function generateRuleForClass(className, knownTokens) {
|
|
|
5820
6205
|
} else {
|
|
5821
6206
|
value = parsed.value;
|
|
5822
6207
|
}
|
|
6208
|
+
if (root === "size") {
|
|
6209
|
+
return `width: ${value}; height: ${value};`;
|
|
6210
|
+
}
|
|
5823
6211
|
if (root === "px") {
|
|
5824
6212
|
return `padding-left: ${value}; padding-right: ${value};`;
|
|
5825
6213
|
}
|
|
@@ -6118,7 +6506,7 @@ function styleObjectToCSS(style) {
|
|
|
6118
6506
|
}
|
|
6119
6507
|
const cssProperty = prop.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
6120
6508
|
let cssValue = String(value);
|
|
6121
|
-
if ((prop === "backgroundColor" || prop === "color" || prop === "borderColor") &&
|
|
6509
|
+
if ((prop === "backgroundColor" || prop === "color" || prop === "borderColor") && isBareColorTokenName(cssValue)) {
|
|
6122
6510
|
cssValue = `var(--${cssValue})`;
|
|
6123
6511
|
}
|
|
6124
6512
|
declarations.push(`${cssProperty}: ${cssValue}`);
|
|
@@ -6384,6 +6772,8 @@ export {
|
|
|
6384
6772
|
presetClassReverse,
|
|
6385
6773
|
CSS_NAMED_COLORS,
|
|
6386
6774
|
isCssNamedColor,
|
|
6775
|
+
THEME_SCALE_ENTRIES,
|
|
6776
|
+
defaultTailwindThemeVariables,
|
|
6387
6777
|
splitVariantPrefix,
|
|
6388
6778
|
breakpointClassPrefixes,
|
|
6389
6779
|
normalizeBreakpointVariant,
|
|
@@ -6449,4 +6839,4 @@ export {
|
|
|
6449
6839
|
generateInteractiveCSS,
|
|
6450
6840
|
generateAllInteractiveCSS
|
|
6451
6841
|
};
|
|
6452
|
-
//# sourceMappingURL=chunk-
|
|
6842
|
+
//# sourceMappingURL=chunk-J4IPTP5X.js.map
|