@bookklik/senangstart-css 0.2.8 → 0.2.9
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/senangstart-css.js +2510 -1927
- package/dist/senangstart-css.min.js +211 -208
- package/dist/senangstart-tw.js +170 -73
- package/dist/senangstart-tw.min.js +1 -1
- package/docs/guide/configuration.md +2 -2
- package/docs/guide/states.md +60 -0
- package/docs/ms/guide/configuration.md +2 -2
- package/docs/ms/guide/states.md +60 -0
- package/docs/ms/reference/colors.md +2 -2
- package/docs/ms/reference/space/height.md +10 -10
- package/docs/ms/reference/space/width.md +12 -12
- package/docs/public/assets/senangstart-css.min.js +211 -208
- package/docs/public/llms.txt +28 -0
- package/docs/reference/colors.md +2 -2
- package/docs/reference/space/height.md +10 -10
- package/docs/reference/space/width.md +12 -12
- package/package.json +1 -1
- package/public/senangstart.css +1 -1
- package/scripts/convert-tailwind.js +191 -68
- package/scripts/generate-llms-txt.js +28 -0
- package/src/cdn/senangstart-engine.js +37 -1927
- package/src/cdn/tw-conversion-engine.js +203 -74
- package/src/compiler/generators/css.js +300 -54
- package/src/compiler/parser.js +14 -4
- package/src/config/defaults.js +1 -1
- package/src/core/constants.js +5 -3
- package/src/definitions/index.js +3 -2
- package/src/definitions/layout.js +2 -2
- package/src/definitions/space.js +45 -19
- package/src/index.js +47 -0
- package/templates/senangstart.config.js +1 -1
- package/tests/helpers/test-utils.js +1 -1
- package/tests/integration/compiler.test.js +12 -1
- package/tests/unit/compiler/generators/css.coverage.test.js +833 -0
- package/tests/unit/compiler/generators/css.test.js +1418 -1
- package/tests/unit/compiler/generators/preflight.test.js +31 -0
- package/tests/unit/compiler/parser.test.js +26 -0
- package/tests/unit/config/defaults.test.js +2 -2
- package/tests/unit/convert-tailwind.cli.test.js +95 -0
- package/tests/unit/convert-tailwind.coverage.test.js +225 -0
- package/tests/unit/convert-tailwind.test.js +49 -20
- package/tests/unit/core/tokenizer-core.test.js +102 -0
- package/tests/unit/definitions/index.test.js +108 -0
- package/tests/unit/definitions/layout_definitions.test.js +40 -0
- package/tests/unit/utils/common.test.js +26 -0
- package/scripts/bundle-jit.js +0 -45
package/dist/senangstart-css.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
(() => {
|
|
3
3
|
// src/core/constants.js
|
|
4
4
|
var BREAKPOINTS = ["mob", "tab", "lap", "desk", "tw-sm", "tw-md", "tw-lg", "tw-xl", "tw-2xl"];
|
|
5
|
-
var STATES = ["hover", "focus", "focus-visible", "active", "disabled", "dark"];
|
|
5
|
+
var STATES = ["hover", "focus", "focus-visible", "active", "disabled", "dark", "expanded", "selected"];
|
|
6
6
|
var LAYOUT_KEYWORDS = [
|
|
7
7
|
"flex",
|
|
8
8
|
"grid",
|
|
@@ -24,7 +24,14 @@
|
|
|
24
24
|
"absolute",
|
|
25
25
|
"relative",
|
|
26
26
|
"fixed",
|
|
27
|
-
"sticky"
|
|
27
|
+
"sticky",
|
|
28
|
+
// State Capabilities
|
|
29
|
+
"hoverable",
|
|
30
|
+
"focusable",
|
|
31
|
+
"pressable",
|
|
32
|
+
"expandable",
|
|
33
|
+
"selectable",
|
|
34
|
+
"disabled"
|
|
28
35
|
];
|
|
29
36
|
|
|
30
37
|
// src/utils/common.js
|
|
@@ -141,6 +148,15 @@
|
|
|
141
148
|
}
|
|
142
149
|
return token;
|
|
143
150
|
}
|
|
151
|
+
function tokenizeAll(parsed) {
|
|
152
|
+
const tokens = [];
|
|
153
|
+
for (const [attrType, values] of Object.entries(parsed)) {
|
|
154
|
+
for (const raw of values) {
|
|
155
|
+
tokens.push(tokenize(raw, attrType));
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
return tokens;
|
|
159
|
+
}
|
|
144
160
|
|
|
145
161
|
// src/compiler/generators/preflight.js
|
|
146
162
|
function generatePreflight(config) {
|
|
@@ -2187,9 +2203,9 @@ video {
|
|
|
2187
2203
|
tableLayout,
|
|
2188
2204
|
captionSide
|
|
2189
2205
|
};
|
|
2190
|
-
function buildLayoutMap() {
|
|
2206
|
+
function buildLayoutMap(definitions = layoutDefinitions) {
|
|
2191
2207
|
const map = {};
|
|
2192
|
-
for (const def of Object.values(
|
|
2208
|
+
for (const def of Object.values(definitions)) {
|
|
2193
2209
|
if (def.dynamic) continue;
|
|
2194
2210
|
if (!def.syntax || !def.syntax.includes('layout="[')) continue;
|
|
2195
2211
|
for (const v of def.values) {
|
|
@@ -2541,16 +2557,41 @@ video {
|
|
|
2541
2557
|
"vast-10x",
|
|
2542
2558
|
"min",
|
|
2543
2559
|
"max",
|
|
2544
|
-
"fit"
|
|
2560
|
+
"fit",
|
|
2561
|
+
// Percentage adjectives
|
|
2562
|
+
"full",
|
|
2563
|
+
"half",
|
|
2564
|
+
"third",
|
|
2565
|
+
"third-2x",
|
|
2566
|
+
"quarter",
|
|
2567
|
+
"quarter-2x",
|
|
2568
|
+
"quarter-3x",
|
|
2569
|
+
// Fractional values (backwards compatibility)
|
|
2570
|
+
"1/1",
|
|
2571
|
+
"1/2",
|
|
2572
|
+
"1/3",
|
|
2573
|
+
"2/3",
|
|
2574
|
+
"1/4",
|
|
2575
|
+
"2/4",
|
|
2576
|
+
"3/4"
|
|
2577
|
+
],
|
|
2578
|
+
percentageAdjectives: [
|
|
2579
|
+
{ name: "full", value: "100%", description: "Full width (100%)", descriptionMs: "Lebar penuh (100%)" },
|
|
2580
|
+
{ name: "half", value: "50%", description: "Half width (50%)", descriptionMs: "Separuh lebar (50%)" },
|
|
2581
|
+
{ name: "third", value: "33.333333%", description: "One third width (33%)", descriptionMs: "Satu pertiga lebar (33%)" },
|
|
2582
|
+
{ name: "third-2x", value: "66.666667%", description: "Two thirds width (66%)", descriptionMs: "Dua pertiga lebar (66%)" },
|
|
2583
|
+
{ name: "quarter", value: "25%", description: "One quarter width (25%)", descriptionMs: "Satu perempat lebar (25%)" },
|
|
2584
|
+
{ name: "quarter-2x", value: "50%", description: "Two quarters width (50%)", descriptionMs: "Dua perempat lebar (50%)" },
|
|
2585
|
+
{ name: "quarter-3x", value: "75%", description: "Three quarters width (75%)", descriptionMs: "Tiga perempat lebar (75%)" }
|
|
2545
2586
|
],
|
|
2546
2587
|
supportsArbitrary: true,
|
|
2547
2588
|
examples: [
|
|
2548
|
-
{ code: '<div space="w:
|
|
2589
|
+
{ code: '<div space="w:full">Full width</div>', description: "Full width" },
|
|
2590
|
+
{ code: '<div space="w:half">Half width</div>', description: "Half width (50%)" },
|
|
2591
|
+
{ code: '<div space="w:third">Third width</div>', description: "One third width (33%)" },
|
|
2592
|
+
{ code: '<div space="w:quarter-3x">Three quarters</div>', description: "Three quarters width (75%)" },
|
|
2549
2593
|
{ code: '<div space="max-w:[1200px]">Max width container</div>', description: "Max width" },
|
|
2550
|
-
{ code: '<div space="
|
|
2551
|
-
{ code: '<div space="w:max">Content width</div>', description: "Width based on content (max-content)" },
|
|
2552
|
-
{ code: '<div space="max-w:max">Max content width</div>', description: "Maximum content width" },
|
|
2553
|
-
{ code: '<div space="min-w:min">Min content width</div>', description: "Minimum content width" }
|
|
2594
|
+
{ code: '<div space="w:max">Content width</div>', description: "Width based on content (max-content)" }
|
|
2554
2595
|
],
|
|
2555
2596
|
preview: [
|
|
2556
2597
|
{
|
|
@@ -2559,11 +2600,11 @@ video {
|
|
|
2559
2600
|
description: "Set fixed or percentage widths",
|
|
2560
2601
|
descriptionMs: "Tetapkan lebar tetap atau peratusan",
|
|
2561
2602
|
html: `<div layout="flex col" space="g:small p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium">
|
|
2562
|
-
<div space="w:
|
|
2563
|
-
<div space="w:
|
|
2564
|
-
<div space="w:
|
|
2603
|
+
<div space="w:full p:small" visual="bg:primary text:white rounded:small">w:full</div>
|
|
2604
|
+
<div space="w:quarter-3x p:small" visual="bg:primary text:white rounded:small">w:quarter-3x</div>
|
|
2605
|
+
<div space="w:half p:small" visual="bg:primary text:white rounded:small">w:half</div>
|
|
2565
2606
|
</div>`,
|
|
2566
|
-
highlightValue: "w:
|
|
2607
|
+
highlightValue: "w:full"
|
|
2567
2608
|
},
|
|
2568
2609
|
{
|
|
2569
2610
|
title: "Content-Based Sizing",
|
|
@@ -2652,15 +2693,40 @@ video {
|
|
|
2652
2693
|
"vast-10x",
|
|
2653
2694
|
"min",
|
|
2654
2695
|
"max",
|
|
2655
|
-
"fit"
|
|
2696
|
+
"fit",
|
|
2697
|
+
// Percentage adjectives
|
|
2698
|
+
"full",
|
|
2699
|
+
"half",
|
|
2700
|
+
"third",
|
|
2701
|
+
"third-2x",
|
|
2702
|
+
"quarter",
|
|
2703
|
+
"quarter-2x",
|
|
2704
|
+
"quarter-3x",
|
|
2705
|
+
// Fractional values (backwards compatibility)
|
|
2706
|
+
"1/1",
|
|
2707
|
+
"1/2",
|
|
2708
|
+
"1/3",
|
|
2709
|
+
"2/3",
|
|
2710
|
+
"1/4",
|
|
2711
|
+
"2/4",
|
|
2712
|
+
"3/4"
|
|
2713
|
+
],
|
|
2714
|
+
percentageAdjectives: [
|
|
2715
|
+
{ name: "full", value: "100%", description: "Full height (100%)", descriptionMs: "Tinggi penuh (100%)" },
|
|
2716
|
+
{ name: "half", value: "50%", description: "Half height (50%)", descriptionMs: "Separuh tinggi (50%)" },
|
|
2717
|
+
{ name: "third", value: "33.333333%", description: "One third height (33%)", descriptionMs: "Satu pertiga tinggi (33%)" },
|
|
2718
|
+
{ name: "third-2x", value: "66.666667%", description: "Two thirds height (66%)", descriptionMs: "Dua pertiga tinggi (66%)" },
|
|
2719
|
+
{ name: "quarter", value: "25%", description: "One quarter height (25%)", descriptionMs: "Satu perempat tinggi (25%)" },
|
|
2720
|
+
{ name: "quarter-2x", value: "50%", description: "Two quarters height (50%)", descriptionMs: "Dua perempat tinggi (50%)" },
|
|
2721
|
+
{ name: "quarter-3x", value: "75%", description: "Three quarters height (75%)", descriptionMs: "Tiga perempat tinggi (75%)" }
|
|
2656
2722
|
],
|
|
2657
2723
|
supportsArbitrary: true,
|
|
2658
2724
|
examples: [
|
|
2659
|
-
{ code: '<div space="h:
|
|
2725
|
+
{ code: '<div space="h:full">Full height</div>', description: "Full height" },
|
|
2726
|
+
{ code: '<div space="h:half">Half height</div>', description: "Half height (50%)" },
|
|
2727
|
+
{ code: '<div space="h:[100vh]">Full viewport height</div>', description: "Full viewport height" },
|
|
2660
2728
|
{ code: '<div space="min-h:[400px]">Min height</div>', description: "Minimum height" },
|
|
2661
|
-
{ code: '<div space="h:max">Content height</div>', description: "Height based on content (max-content)" }
|
|
2662
|
-
{ code: '<div space="max-h:max">Max content height</div>', description: "Maximum content height" },
|
|
2663
|
-
{ code: '<div space="min-h:min">Min content height</div>', description: "Minimum content height" }
|
|
2729
|
+
{ code: '<div space="h:max">Content height</div>', description: "Height based on content (max-content)" }
|
|
2664
2730
|
],
|
|
2665
2731
|
preview: [
|
|
2666
2732
|
{
|
|
@@ -2669,11 +2735,11 @@ video {
|
|
|
2669
2735
|
description: "Set fixed heights",
|
|
2670
2736
|
descriptionMs: "Tetapkan tinggi tetap",
|
|
2671
2737
|
html: `<div layout="flex" space="g:small p:medium" visual="bg:neutral-100 dark:bg:neutral-900 rounded:medium" style="height: 120px;">
|
|
2672
|
-
<div space="h:
|
|
2673
|
-
<div space="h:
|
|
2674
|
-
<div space="h:
|
|
2738
|
+
<div space="h:full p:small" visual="bg:primary text:white rounded:small" layout="flex center">h:full</div>
|
|
2739
|
+
<div space="h:third-2x p:small" visual="bg:primary text:white rounded:small" layout="flex center">h:third-2x</div>
|
|
2740
|
+
<div space="h:half p:small" visual="bg:primary text:white rounded:small" layout="flex center">h:half</div>
|
|
2675
2741
|
</div>`,
|
|
2676
|
-
highlightValue: "h:
|
|
2742
|
+
highlightValue: "h:full"
|
|
2677
2743
|
},
|
|
2678
2744
|
{
|
|
2679
2745
|
title: "Content-Based Height",
|
|
@@ -6784,1887 +6850,2485 @@ video {
|
|
|
6784
6850
|
};
|
|
6785
6851
|
}
|
|
6786
6852
|
|
|
6787
|
-
// src/
|
|
6788
|
-
(
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
// Hairline (for borders)
|
|
6797
|
-
"regular": "2px",
|
|
6798
|
-
// Standard border
|
|
6799
|
-
"thick": "3px",
|
|
6800
|
-
// Bold border
|
|
6801
|
-
"tiny": "4px",
|
|
6802
|
-
// Small offsets
|
|
6803
|
-
"tiny-2x": "6px",
|
|
6804
|
-
// Tiny multiplied
|
|
6805
|
-
"small": "8px",
|
|
6806
|
-
"small-2x": "10px",
|
|
6807
|
-
"small-3x": "12px",
|
|
6808
|
-
"small-4x": "14px",
|
|
6809
|
-
"medium": "16px",
|
|
6810
|
-
"medium-2x": "20px",
|
|
6811
|
-
"medium-3x": "24px",
|
|
6812
|
-
"medium-4x": "28px",
|
|
6813
|
-
"large": "32px",
|
|
6814
|
-
"large-2x": "36px",
|
|
6815
|
-
"large-3x": "40px",
|
|
6816
|
-
"large-4x": "44px",
|
|
6817
|
-
"big": "48px",
|
|
6818
|
-
"big-2x": "56px",
|
|
6819
|
-
"big-3x": "64px",
|
|
6820
|
-
"big-4x": "80px",
|
|
6821
|
-
"giant": "96px",
|
|
6822
|
-
"giant-2x": "112px",
|
|
6823
|
-
"giant-3x": "128px",
|
|
6824
|
-
"giant-4x": "144px",
|
|
6825
|
-
"vast": "160px",
|
|
6826
|
-
"vast-2x": "176px",
|
|
6827
|
-
"vast-3x": "192px",
|
|
6828
|
-
"vast-4x": "208px",
|
|
6829
|
-
"vast-5x": "224px",
|
|
6830
|
-
"vast-6x": "240px",
|
|
6831
|
-
"vast-7x": "256px",
|
|
6832
|
-
"vast-8x": "288px",
|
|
6833
|
-
"vast-9x": "320px",
|
|
6834
|
-
"vast-10x": "384px"
|
|
6835
|
-
},
|
|
6836
|
-
radius: {
|
|
6837
|
-
"none": "0px",
|
|
6838
|
-
"small": "4px",
|
|
6839
|
-
"medium": "8px",
|
|
6840
|
-
"big": "16px",
|
|
6841
|
-
"round": "9999px"
|
|
6842
|
-
},
|
|
6843
|
-
shadow: {
|
|
6844
|
-
"none": "none",
|
|
6845
|
-
"small": "0 1px 2px rgba(0,0,0,0.05)",
|
|
6846
|
-
"medium": "0 4px 6px rgba(0,0,0,0.1)",
|
|
6847
|
-
"big": "0 10px 15px rgba(0,0,0,0.15)",
|
|
6848
|
-
"giant": "0 25px 50px rgba(0,0,0,0.25)"
|
|
6849
|
-
},
|
|
6850
|
-
fontSize: {
|
|
6851
|
-
"mini": "0.75rem",
|
|
6852
|
-
// 12px
|
|
6853
|
-
"small": "0.875rem",
|
|
6854
|
-
// 14px
|
|
6855
|
-
"base": "1rem",
|
|
6856
|
-
// 16px
|
|
6857
|
-
"large": "1.125rem",
|
|
6858
|
-
// 18px
|
|
6859
|
-
"big": "1.25rem",
|
|
6860
|
-
// 20px
|
|
6861
|
-
"huge": "1.5rem",
|
|
6862
|
-
// 24px
|
|
6863
|
-
"grand": "1.875rem",
|
|
6864
|
-
// 30px
|
|
6865
|
-
"giant": "2.25rem",
|
|
6866
|
-
// 36px
|
|
6867
|
-
"mount": "3rem",
|
|
6868
|
-
// 48px
|
|
6869
|
-
"mega": "3.75rem",
|
|
6870
|
-
// 60px
|
|
6871
|
-
"giga": "4.5rem",
|
|
6872
|
-
// 72px
|
|
6873
|
-
"tera": "6rem",
|
|
6874
|
-
// 96px
|
|
6875
|
-
"hero": "8rem"
|
|
6876
|
-
// 128px
|
|
6877
|
-
},
|
|
6878
|
-
fontSizeLineHeight: {
|
|
6879
|
-
"mini": "1rem",
|
|
6880
|
-
// 16px
|
|
6881
|
-
"small": "1.25rem",
|
|
6882
|
-
// 20px
|
|
6883
|
-
"base": "1.5rem",
|
|
6884
|
-
// 24px
|
|
6885
|
-
"large": "1.75rem",
|
|
6886
|
-
// 28px
|
|
6887
|
-
"big": "1.75rem",
|
|
6888
|
-
// 28px
|
|
6889
|
-
"huge": "2rem",
|
|
6890
|
-
// 32px
|
|
6891
|
-
"grand": "2.25rem",
|
|
6892
|
-
// 36px
|
|
6893
|
-
"giant": "2.5rem",
|
|
6894
|
-
// 40px
|
|
6895
|
-
"mount": "1",
|
|
6896
|
-
// unitless 1
|
|
6897
|
-
"mega": "1",
|
|
6898
|
-
// unitless 1
|
|
6899
|
-
"giga": "1",
|
|
6900
|
-
// unitless 1
|
|
6901
|
-
"tera": "1",
|
|
6902
|
-
// unitless 1
|
|
6903
|
-
"hero": "1"
|
|
6904
|
-
// unitless 1
|
|
6905
|
-
},
|
|
6906
|
-
fontWeight: {
|
|
6907
|
-
"normal": "400",
|
|
6908
|
-
"medium": "500",
|
|
6909
|
-
"bold": "700"
|
|
6910
|
-
},
|
|
6911
|
-
screens: {
|
|
6912
|
-
"mob": "480px",
|
|
6913
|
-
"tab": "768px",
|
|
6914
|
-
"lap": "1024px",
|
|
6915
|
-
"desk": "1280px",
|
|
6916
|
-
// Tailwind compatibility
|
|
6917
|
-
"tw-sm": "640px",
|
|
6918
|
-
"tw-md": "768px",
|
|
6919
|
-
"tw-lg": "1024px",
|
|
6920
|
-
"tw-xl": "1280px",
|
|
6921
|
-
"tw-2xl": "1536px"
|
|
6922
|
-
},
|
|
6923
|
-
colors: {
|
|
6924
|
-
// Base colors
|
|
6925
|
-
"white": "#FFFFFF",
|
|
6926
|
-
"black": "#000000",
|
|
6927
|
-
// Brand/Semantic colors
|
|
6928
|
-
"grey": "#6B7280",
|
|
6929
|
-
"dark": "#3E4A5D",
|
|
6930
|
-
"light": "#DBEAFE",
|
|
6931
|
-
"primary": "#2563EB",
|
|
6932
|
-
"secondary": "#DBEAFE",
|
|
6933
|
-
"success": "#10B981",
|
|
6934
|
-
"warning": "#F59E0B",
|
|
6935
|
-
"danger": "#EF4444",
|
|
6936
|
-
// Red
|
|
6937
|
-
"red-50": "#FEF2F2",
|
|
6938
|
-
"red-100": "#FEE2E2",
|
|
6939
|
-
"red-200": "#FECACA",
|
|
6940
|
-
"red-300": "#FCA5A5",
|
|
6941
|
-
"red-400": "#F87171",
|
|
6942
|
-
"red-500": "#EF4444",
|
|
6943
|
-
"red-600": "#DC2626",
|
|
6944
|
-
"red-700": "#B91C1C",
|
|
6945
|
-
"red-800": "#991B1B",
|
|
6946
|
-
"red-900": "#7F1D1D",
|
|
6947
|
-
"red-950": "#450A0A",
|
|
6948
|
-
// Orange
|
|
6949
|
-
"orange-50": "#FFF7ED",
|
|
6950
|
-
"orange-100": "#FFEDD5",
|
|
6951
|
-
"orange-200": "#FED7AA",
|
|
6952
|
-
"orange-300": "#FDBA74",
|
|
6953
|
-
"orange-400": "#FB923C",
|
|
6954
|
-
"orange-500": "#F97316",
|
|
6955
|
-
"orange-600": "#EA580C",
|
|
6956
|
-
"orange-700": "#C2410C",
|
|
6957
|
-
"orange-800": "#9A3412",
|
|
6958
|
-
"orange-900": "#7C2D12",
|
|
6959
|
-
"orange-950": "#431407",
|
|
6960
|
-
// Amber
|
|
6961
|
-
"amber-50": "#FFFBEB",
|
|
6962
|
-
"amber-100": "#FEF3C7",
|
|
6963
|
-
"amber-200": "#FDE68A",
|
|
6964
|
-
"amber-300": "#FCD34D",
|
|
6965
|
-
"amber-400": "#FBBF24",
|
|
6966
|
-
"amber-500": "#F59E0B",
|
|
6967
|
-
"amber-600": "#D97706",
|
|
6968
|
-
"amber-700": "#B45309",
|
|
6969
|
-
"amber-800": "#92400E",
|
|
6970
|
-
"amber-900": "#78350F",
|
|
6971
|
-
"amber-950": "#451A03",
|
|
6972
|
-
// Yellow
|
|
6973
|
-
"yellow-50": "#FEFCE8",
|
|
6974
|
-
"yellow-100": "#FEF9C3",
|
|
6975
|
-
"yellow-200": "#FEF08A",
|
|
6976
|
-
"yellow-300": "#FDE047",
|
|
6977
|
-
"yellow-400": "#FACC15",
|
|
6978
|
-
"yellow-500": "#EAB308",
|
|
6979
|
-
"yellow-600": "#CA8A04",
|
|
6980
|
-
"yellow-700": "#A16207",
|
|
6981
|
-
"yellow-800": "#854D0E",
|
|
6982
|
-
"yellow-900": "#713F12",
|
|
6983
|
-
"yellow-950": "#422006",
|
|
6984
|
-
// Lime
|
|
6985
|
-
"lime-50": "#F7FEE7",
|
|
6986
|
-
"lime-100": "#ECFCCB",
|
|
6987
|
-
"lime-200": "#D9F99D",
|
|
6988
|
-
"lime-300": "#BEF264",
|
|
6989
|
-
"lime-400": "#A3E635",
|
|
6990
|
-
"lime-500": "#84CC16",
|
|
6991
|
-
"lime-600": "#65A30D",
|
|
6992
|
-
"lime-700": "#4D7C0F",
|
|
6993
|
-
"lime-800": "#3F6212",
|
|
6994
|
-
"lime-900": "#365314",
|
|
6995
|
-
"lime-950": "#1A2E05",
|
|
6996
|
-
// Green
|
|
6997
|
-
"green-50": "#F0FDF4",
|
|
6998
|
-
"green-100": "#DCFCE7",
|
|
6999
|
-
"green-200": "#BBF7D0",
|
|
7000
|
-
"green-300": "#86EFAC",
|
|
7001
|
-
"green-400": "#4ADE80",
|
|
7002
|
-
"green-500": "#22C55E",
|
|
7003
|
-
"green-600": "#16A34A",
|
|
7004
|
-
"green-700": "#15803D",
|
|
7005
|
-
"green-800": "#166534",
|
|
7006
|
-
"green-900": "#14532D",
|
|
7007
|
-
"green-950": "#052E16",
|
|
7008
|
-
// Emerald
|
|
7009
|
-
"emerald-50": "#ECFDF5",
|
|
7010
|
-
"emerald-100": "#D1FAE5",
|
|
7011
|
-
"emerald-200": "#A7F3D0",
|
|
7012
|
-
"emerald-300": "#6EE7B7",
|
|
7013
|
-
"emerald-400": "#34D399",
|
|
7014
|
-
"emerald-500": "#10B981",
|
|
7015
|
-
"emerald-600": "#059669",
|
|
7016
|
-
"emerald-700": "#047857",
|
|
7017
|
-
"emerald-800": "#065F46",
|
|
7018
|
-
"emerald-900": "#064E3B",
|
|
7019
|
-
"emerald-950": "#022C22",
|
|
7020
|
-
// Teal
|
|
7021
|
-
"teal-50": "#F0FDFA",
|
|
7022
|
-
"teal-100": "#CCFBF1",
|
|
7023
|
-
"teal-200": "#99F6E4",
|
|
7024
|
-
"teal-300": "#5EEAD4",
|
|
7025
|
-
"teal-400": "#2DD4BF",
|
|
7026
|
-
"teal-500": "#14B8A6",
|
|
7027
|
-
"teal-600": "#0D9488",
|
|
7028
|
-
"teal-700": "#0F766E",
|
|
7029
|
-
"teal-800": "#115E59",
|
|
7030
|
-
"teal-900": "#134E4A",
|
|
7031
|
-
"teal-950": "#042F2E",
|
|
7032
|
-
// Cyan
|
|
7033
|
-
"cyan-50": "#ECFEFF",
|
|
7034
|
-
"cyan-100": "#CFFAFE",
|
|
7035
|
-
"cyan-200": "#A5F3FC",
|
|
7036
|
-
"cyan-300": "#67E8F9",
|
|
7037
|
-
"cyan-400": "#22D3EE",
|
|
7038
|
-
"cyan-500": "#06B6D4",
|
|
7039
|
-
"cyan-600": "#0891B2",
|
|
7040
|
-
"cyan-700": "#0E7490",
|
|
7041
|
-
"cyan-800": "#155E75",
|
|
7042
|
-
"cyan-900": "#164E63",
|
|
7043
|
-
"cyan-950": "#083344",
|
|
7044
|
-
// Sky
|
|
7045
|
-
"sky-50": "#F0F9FF",
|
|
7046
|
-
"sky-100": "#E0F2FE",
|
|
7047
|
-
"sky-200": "#BAE6FD",
|
|
7048
|
-
"sky-300": "#7DD3FC",
|
|
7049
|
-
"sky-400": "#38BDF8",
|
|
7050
|
-
"sky-500": "#0EA5E9",
|
|
7051
|
-
"sky-600": "#0284C7",
|
|
7052
|
-
"sky-700": "#0369A1",
|
|
7053
|
-
"sky-800": "#075985",
|
|
7054
|
-
"sky-900": "#0C4A6E",
|
|
7055
|
-
"sky-950": "#082F49",
|
|
7056
|
-
// Blue
|
|
7057
|
-
"blue-50": "#EFF6FF",
|
|
7058
|
-
"blue-100": "#DBEAFE",
|
|
7059
|
-
"blue-200": "#BFDBFE",
|
|
7060
|
-
"blue-300": "#93C5FD",
|
|
7061
|
-
"blue-400": "#60A5FA",
|
|
7062
|
-
"blue-500": "#3B82F6",
|
|
7063
|
-
"blue-600": "#2563EB",
|
|
7064
|
-
"blue-700": "#1D4ED8",
|
|
7065
|
-
"blue-800": "#1E40AF",
|
|
7066
|
-
"blue-900": "#1E3A8A",
|
|
7067
|
-
"blue-950": "#172554",
|
|
7068
|
-
// Indigo
|
|
7069
|
-
"indigo-50": "#EEF2FF",
|
|
7070
|
-
"indigo-100": "#E0E7FF",
|
|
7071
|
-
"indigo-200": "#C7D2FE",
|
|
7072
|
-
"indigo-300": "#A5B4FC",
|
|
7073
|
-
"indigo-400": "#818CF8",
|
|
7074
|
-
"indigo-500": "#6366F1",
|
|
7075
|
-
"indigo-600": "#4F46E5",
|
|
7076
|
-
"indigo-700": "#4338CA",
|
|
7077
|
-
"indigo-800": "#3730A3",
|
|
7078
|
-
"indigo-900": "#312E81",
|
|
7079
|
-
"indigo-950": "#1E1B4B",
|
|
7080
|
-
// Violet
|
|
7081
|
-
"violet-50": "#F5F3FF",
|
|
7082
|
-
"violet-100": "#EDE9FE",
|
|
7083
|
-
"violet-200": "#DDD6FE",
|
|
7084
|
-
"violet-300": "#C4B5FD",
|
|
7085
|
-
"violet-400": "#A78BFA",
|
|
7086
|
-
"violet-500": "#8B5CF6",
|
|
7087
|
-
"violet-600": "#7C3AED",
|
|
7088
|
-
"violet-700": "#6D28D9",
|
|
7089
|
-
"violet-800": "#5B21B6",
|
|
7090
|
-
"violet-900": "#4C1D95",
|
|
7091
|
-
"violet-950": "#2E1065",
|
|
7092
|
-
// Purple
|
|
7093
|
-
"purple-50": "#FAF5FF",
|
|
7094
|
-
"purple-100": "#F3E8FF",
|
|
7095
|
-
"purple-200": "#E9D5FF",
|
|
7096
|
-
"purple-300": "#D8B4FE",
|
|
7097
|
-
"purple-400": "#C084FC",
|
|
7098
|
-
"purple-500": "#A855F7",
|
|
7099
|
-
"purple-600": "#9333EA",
|
|
7100
|
-
"purple-700": "#7E22CE",
|
|
7101
|
-
"purple-800": "#6B21A8",
|
|
7102
|
-
"purple-900": "#581C87",
|
|
7103
|
-
"purple-950": "#3B0764",
|
|
7104
|
-
// Fuchsia
|
|
7105
|
-
"fuchsia-50": "#FDF4FF",
|
|
7106
|
-
"fuchsia-100": "#FAE8FF",
|
|
7107
|
-
"fuchsia-200": "#F5D0FE",
|
|
7108
|
-
"fuchsia-300": "#F0ABFC",
|
|
7109
|
-
"fuchsia-400": "#E879F9",
|
|
7110
|
-
"fuchsia-500": "#D946EF",
|
|
7111
|
-
"fuchsia-600": "#C026D3",
|
|
7112
|
-
"fuchsia-700": "#A21CAF",
|
|
7113
|
-
"fuchsia-800": "#86198F",
|
|
7114
|
-
"fuchsia-900": "#701A75",
|
|
7115
|
-
"fuchsia-950": "#4A044E",
|
|
7116
|
-
// Pink
|
|
7117
|
-
"pink-50": "#FDF2F8",
|
|
7118
|
-
"pink-100": "#FCE7F3",
|
|
7119
|
-
"pink-200": "#FBCFE8",
|
|
7120
|
-
"pink-300": "#F9A8D4",
|
|
7121
|
-
"pink-400": "#F472B6",
|
|
7122
|
-
"pink-500": "#EC4899",
|
|
7123
|
-
"pink-600": "#DB2777",
|
|
7124
|
-
"pink-700": "#BE185D",
|
|
7125
|
-
"pink-800": "#9D174D",
|
|
7126
|
-
"pink-900": "#831843",
|
|
7127
|
-
"pink-950": "#500724",
|
|
7128
|
-
// Rose
|
|
7129
|
-
"rose-50": "#FFF1F2",
|
|
7130
|
-
"rose-100": "#FFE4E6",
|
|
7131
|
-
"rose-200": "#FECDD3",
|
|
7132
|
-
"rose-300": "#FDA4AF",
|
|
7133
|
-
"rose-400": "#FB7185",
|
|
7134
|
-
"rose-500": "#F43F5E",
|
|
7135
|
-
"rose-600": "#E11D48",
|
|
7136
|
-
"rose-700": "#BE123C",
|
|
7137
|
-
"rose-800": "#9F1239",
|
|
7138
|
-
"rose-900": "#881337",
|
|
7139
|
-
"rose-950": "#4C0519",
|
|
7140
|
-
// Slate
|
|
7141
|
-
"slate-50": "#F8FAFC",
|
|
7142
|
-
"slate-100": "#F1F5F9",
|
|
7143
|
-
"slate-200": "#E2E8F0",
|
|
7144
|
-
"slate-300": "#CBD5E1",
|
|
7145
|
-
"slate-400": "#94A3B8",
|
|
7146
|
-
"slate-500": "#64748B",
|
|
7147
|
-
"slate-600": "#475569",
|
|
7148
|
-
"slate-700": "#334155",
|
|
7149
|
-
"slate-800": "#1E293B",
|
|
7150
|
-
"slate-900": "#0F172A",
|
|
7151
|
-
"slate-950": "#020617",
|
|
7152
|
-
// Gray
|
|
7153
|
-
"gray-50": "#F9FAFB",
|
|
7154
|
-
"gray-100": "#F3F4F6",
|
|
7155
|
-
"gray-200": "#E5E7EB",
|
|
7156
|
-
"gray-300": "#D1D5DB",
|
|
7157
|
-
"gray-400": "#9CA3AF",
|
|
7158
|
-
"gray-500": "#6B7280",
|
|
7159
|
-
"gray-600": "#4B5563",
|
|
7160
|
-
"gray-700": "#374151",
|
|
7161
|
-
"gray-800": "#1F2937",
|
|
7162
|
-
"gray-900": "#111827",
|
|
7163
|
-
"gray-950": "#030712",
|
|
7164
|
-
// Zinc
|
|
7165
|
-
"zinc-50": "#FAFAFA",
|
|
7166
|
-
"zinc-100": "#F4F4F5",
|
|
7167
|
-
"zinc-200": "#E4E4E7",
|
|
7168
|
-
"zinc-300": "#D4D4D8",
|
|
7169
|
-
"zinc-400": "#A1A1AA",
|
|
7170
|
-
"zinc-500": "#71717A",
|
|
7171
|
-
"zinc-600": "#52525B",
|
|
7172
|
-
"zinc-700": "#3F3F46",
|
|
7173
|
-
"zinc-800": "#27272A",
|
|
7174
|
-
"zinc-900": "#18181B",
|
|
7175
|
-
"zinc-950": "#09090B",
|
|
7176
|
-
// Neutral
|
|
7177
|
-
"neutral-50": "#FAFAFA",
|
|
7178
|
-
"neutral-100": "#F5F5F5",
|
|
7179
|
-
"neutral-200": "#E5E5E5",
|
|
7180
|
-
"neutral-300": "#D4D4D4",
|
|
7181
|
-
"neutral-400": "#A3A3A3",
|
|
7182
|
-
"neutral-500": "#737373",
|
|
7183
|
-
"neutral-600": "#525252",
|
|
7184
|
-
"neutral-700": "#404040",
|
|
7185
|
-
"neutral-800": "#262626",
|
|
7186
|
-
"neutral-900": "#171717",
|
|
7187
|
-
"neutral-950": "#0A0A0A",
|
|
7188
|
-
// Stone
|
|
7189
|
-
"stone-50": "#FAFAF9",
|
|
7190
|
-
"stone-100": "#F5F5F4",
|
|
7191
|
-
"stone-200": "#E7E5E4",
|
|
7192
|
-
"stone-300": "#D6D3D1",
|
|
7193
|
-
"stone-400": "#A8A29E",
|
|
7194
|
-
"stone-500": "#78716C",
|
|
7195
|
-
"stone-600": "#57534E",
|
|
7196
|
-
"stone-700": "#44403C",
|
|
7197
|
-
"stone-800": "#292524",
|
|
7198
|
-
"stone-900": "#1C1917",
|
|
7199
|
-
"stone-950": "#0C0A09"
|
|
7200
|
-
},
|
|
7201
|
-
zIndex: {
|
|
7202
|
-
"base": "0",
|
|
7203
|
-
"low": "10",
|
|
7204
|
-
"mid": "50",
|
|
7205
|
-
"high": "100",
|
|
7206
|
-
"top": "9999"
|
|
7207
|
-
},
|
|
7208
|
-
ring: {
|
|
7209
|
-
"none": "0px",
|
|
7210
|
-
"thin": "1px",
|
|
7211
|
-
"regular": "2px",
|
|
7212
|
-
"thick": "3px",
|
|
7213
|
-
"small": "4px",
|
|
7214
|
-
"medium": "6px",
|
|
7215
|
-
"big": "8px"
|
|
7216
|
-
}
|
|
7217
|
-
},
|
|
7218
|
-
// Dark mode configuration
|
|
7219
|
-
// 'media' - Uses @media (prefers-color-scheme: dark)
|
|
7220
|
-
// 'selector' - Uses .dark class on html/body
|
|
7221
|
-
darkMode: "media",
|
|
7222
|
-
// Preflight: Include opinionated base reset styles
|
|
7223
|
-
// true - Include all preflight styles (default)
|
|
7224
|
-
// false - Disable preflight completely
|
|
7225
|
-
preflight: true
|
|
7226
|
-
};
|
|
7227
|
-
const configSchema = {
|
|
7228
|
-
theme: {
|
|
7229
|
-
type: "object",
|
|
7230
|
-
properties: {
|
|
7231
|
-
spacing: { type: "object" },
|
|
7232
|
-
radius: { type: "object" },
|
|
7233
|
-
shadow: { type: "object" },
|
|
7234
|
-
fontSize: { type: "object" },
|
|
7235
|
-
fontWeight: { type: "object" },
|
|
7236
|
-
screens: { type: "object" },
|
|
7237
|
-
colors: { type: "object" },
|
|
7238
|
-
zIndex: { type: "object" },
|
|
7239
|
-
ring: { type: "object" }
|
|
7240
|
-
}
|
|
7241
|
-
},
|
|
7242
|
-
darkMode: { type: "string", enum: ["media", "selector"] },
|
|
7243
|
-
preflight: { type: "boolean" }
|
|
7244
|
-
};
|
|
7245
|
-
function validateConfig(config) {
|
|
7246
|
-
if (!config || typeof config !== "object" || Array.isArray(config)) {
|
|
7247
|
-
return false;
|
|
7248
|
-
}
|
|
7249
|
-
if (config.theme && (typeof config.theme !== "object" || Array.isArray(config.theme))) {
|
|
7250
|
-
return false;
|
|
7251
|
-
}
|
|
7252
|
-
if (config.darkMode !== void 0 && config.darkMode !== "media" && config.darkMode !== "selector" && !Array.isArray(config.darkMode)) {
|
|
7253
|
-
return false;
|
|
7254
|
-
}
|
|
7255
|
-
if (config.preflight !== void 0 && typeof config.preflight !== "boolean") {
|
|
7256
|
-
return false;
|
|
7257
|
-
}
|
|
7258
|
-
return true;
|
|
6853
|
+
// src/compiler/generators/css.js
|
|
6854
|
+
var { layoutMap, typographyKeywords: typographyKeywords2 } = buildAllMaps();
|
|
6855
|
+
function sanitizeArbitraryValue(value) {
|
|
6856
|
+
return sanitizeValue(value);
|
|
6857
|
+
}
|
|
6858
|
+
var CSS_COLOR_KEYWORDS = ["transparent", "currentColor", "inherit", "initial", "unset"];
|
|
6859
|
+
function resolveColorValue(value, isArbitrary) {
|
|
6860
|
+
if (isArbitrary) {
|
|
6861
|
+
return value;
|
|
7259
6862
|
}
|
|
7260
|
-
|
|
7261
|
-
|
|
7262
|
-
if (!configEl) return {};
|
|
7263
|
-
try {
|
|
7264
|
-
const parsed = JSON.parse(configEl.textContent);
|
|
7265
|
-
if (!validateConfig(parsed)) {
|
|
7266
|
-
console.error("[SenangStart] Invalid config structure");
|
|
7267
|
-
return {};
|
|
7268
|
-
}
|
|
7269
|
-
return parsed;
|
|
7270
|
-
} catch (e) {
|
|
7271
|
-
console.error("[SenangStart] Invalid config JSON:", e);
|
|
7272
|
-
return {};
|
|
7273
|
-
}
|
|
6863
|
+
if (CSS_COLOR_KEYWORDS.includes(value)) {
|
|
6864
|
+
return value;
|
|
7274
6865
|
}
|
|
7275
|
-
|
|
7276
|
-
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
if (user.theme[key]) {
|
|
7284
|
-
merged.theme[key] = { ...merged.theme[key], ...user.theme[key] };
|
|
7285
|
-
}
|
|
7286
|
-
}
|
|
7287
|
-
}
|
|
7288
|
-
if (user.darkMode !== void 0) {
|
|
7289
|
-
merged.darkMode = user.darkMode;
|
|
7290
|
-
}
|
|
7291
|
-
if (user.preflight !== void 0) {
|
|
7292
|
-
merged.preflight = user.preflight;
|
|
7293
|
-
}
|
|
7294
|
-
return merged;
|
|
6866
|
+
return `var(--c-${value})`;
|
|
6867
|
+
}
|
|
6868
|
+
function generateCSSVariables(config) {
|
|
6869
|
+
const { theme } = config;
|
|
6870
|
+
let css = ":root {\n";
|
|
6871
|
+
for (const [key, value] of Object.entries(theme.spacing)) {
|
|
6872
|
+
css += ` --s-${key}: ${value};
|
|
6873
|
+
`;
|
|
7295
6874
|
}
|
|
7296
|
-
|
|
7297
|
-
|
|
7298
|
-
let css = ":root {\n";
|
|
7299
|
-
for (const [key, value] of Object.entries(theme.spacing)) {
|
|
7300
|
-
css += ` --s-${key}: ${value};
|
|
6875
|
+
for (const [key, value] of Object.entries(theme.radius)) {
|
|
6876
|
+
css += ` --r-${key}: ${value};
|
|
7301
6877
|
`;
|
|
7302
|
-
|
|
7303
|
-
|
|
7304
|
-
|
|
6878
|
+
}
|
|
6879
|
+
for (const [key, value] of Object.entries(theme.shadow)) {
|
|
6880
|
+
css += ` --shadow-${key}: ${value};
|
|
7305
6881
|
`;
|
|
7306
|
-
|
|
7307
|
-
|
|
7308
|
-
|
|
6882
|
+
}
|
|
6883
|
+
for (const [key, value] of Object.entries(theme.fontSize)) {
|
|
6884
|
+
css += ` --font-${key}: ${value};
|
|
7309
6885
|
`;
|
|
7310
|
-
|
|
7311
|
-
|
|
7312
|
-
|
|
6886
|
+
}
|
|
6887
|
+
if (theme.fontSizeLineHeight) {
|
|
6888
|
+
for (const [key, value] of Object.entries(theme.fontSizeLineHeight)) {
|
|
6889
|
+
css += ` --font-lh-${key}: ${value};
|
|
7313
6890
|
`;
|
|
7314
6891
|
}
|
|
7315
|
-
|
|
7316
|
-
|
|
7317
|
-
|
|
6892
|
+
}
|
|
6893
|
+
for (const [key, value] of Object.entries(theme.fontWeight)) {
|
|
6894
|
+
css += ` --fw-${key}: ${value};
|
|
7318
6895
|
`;
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
css += ` --fw-${key}: ${value};
|
|
6896
|
+
}
|
|
6897
|
+
for (const [key, value] of Object.entries(theme.colors)) {
|
|
6898
|
+
css += ` --c-${key}: ${value};
|
|
7323
6899
|
`;
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
6900
|
+
}
|
|
6901
|
+
for (const [key, value] of Object.entries(theme.zIndex)) {
|
|
6902
|
+
css += ` --z-${key}: ${value};
|
|
7327
6903
|
`;
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
6904
|
+
}
|
|
6905
|
+
const twSpacing = {
|
|
6906
|
+
"0": "0px",
|
|
6907
|
+
"px": "1px",
|
|
6908
|
+
"0.5": "0.125rem",
|
|
6909
|
+
"1": "0.25rem",
|
|
6910
|
+
"1.5": "0.375rem",
|
|
6911
|
+
"2": "0.5rem",
|
|
6912
|
+
"2.5": "0.625rem",
|
|
6913
|
+
"3": "0.75rem",
|
|
6914
|
+
"3.5": "0.875rem",
|
|
6915
|
+
"4": "1rem",
|
|
6916
|
+
"5": "1.25rem",
|
|
6917
|
+
"6": "1.5rem",
|
|
6918
|
+
"7": "1.75rem",
|
|
6919
|
+
"8": "2rem",
|
|
6920
|
+
"9": "2.25rem",
|
|
6921
|
+
"10": "2.5rem",
|
|
6922
|
+
"11": "2.75rem",
|
|
6923
|
+
"12": "3rem",
|
|
6924
|
+
"14": "3.5rem",
|
|
6925
|
+
"16": "4rem",
|
|
6926
|
+
"20": "5rem",
|
|
6927
|
+
"24": "6rem",
|
|
6928
|
+
"28": "7rem",
|
|
6929
|
+
"32": "8rem",
|
|
6930
|
+
"36": "9rem",
|
|
6931
|
+
"40": "10rem",
|
|
6932
|
+
"44": "11rem",
|
|
6933
|
+
"48": "12rem",
|
|
6934
|
+
"52": "13rem",
|
|
6935
|
+
"56": "14rem",
|
|
6936
|
+
"60": "15rem",
|
|
6937
|
+
"64": "16rem",
|
|
6938
|
+
"72": "18rem",
|
|
6939
|
+
"80": "20rem",
|
|
6940
|
+
"96": "24rem"
|
|
6941
|
+
};
|
|
6942
|
+
for (const [key, value] of Object.entries(twSpacing)) {
|
|
6943
|
+
css += ` --tw-${key.replace(/\./g, "\\\\.")}: ${value};
|
|
7331
6944
|
`;
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
6945
|
+
}
|
|
6946
|
+
const twRadius = {
|
|
6947
|
+
"none": "0px",
|
|
6948
|
+
"sm": "0.125rem",
|
|
6949
|
+
"DEFAULT": "0.25rem",
|
|
6950
|
+
"md": "0.375rem",
|
|
6951
|
+
"lg": "0.5rem",
|
|
6952
|
+
"xl": "0.75rem",
|
|
6953
|
+
"2xl": "1rem",
|
|
6954
|
+
"3xl": "1.5rem",
|
|
6955
|
+
"full": "9999px"
|
|
6956
|
+
};
|
|
6957
|
+
for (const [key, value] of Object.entries(twRadius)) {
|
|
6958
|
+
css += ` --r-tw-${key}: ${value};
|
|
7336
6959
|
`;
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
6960
|
+
}
|
|
6961
|
+
const twShadow = {
|
|
6962
|
+
"sm": "0 1px 2px 0 rgb(0 0 0 / 0.05)",
|
|
6963
|
+
"DEFAULT": "0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",
|
|
6964
|
+
"md": "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",
|
|
6965
|
+
"lg": "0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",
|
|
6966
|
+
"xl": "0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)",
|
|
6967
|
+
"2xl": "0 25px 50px -12px rgb(0 0 0 / 0.25)",
|
|
6968
|
+
"inner": "inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",
|
|
6969
|
+
"none": "0 0 #0000"
|
|
6970
|
+
};
|
|
6971
|
+
for (const [key, value] of Object.entries(twShadow)) {
|
|
6972
|
+
css += ` --shadow-tw-${key}: ${value};
|
|
7340
6973
|
`;
|
|
7341
|
-
|
|
6974
|
+
}
|
|
6975
|
+
const twFontSize = {
|
|
6976
|
+
"xs": "0.75rem",
|
|
6977
|
+
"sm": "0.875rem",
|
|
6978
|
+
"base": "1rem",
|
|
6979
|
+
"lg": "1.125rem",
|
|
6980
|
+
"xl": "1.25rem",
|
|
6981
|
+
"2xl": "1.5rem",
|
|
6982
|
+
"3xl": "1.875rem",
|
|
6983
|
+
"4xl": "2.25rem",
|
|
6984
|
+
"5xl": "3rem",
|
|
6985
|
+
"6xl": "3.75rem",
|
|
6986
|
+
"7xl": "4.5rem",
|
|
6987
|
+
"8xl": "6rem",
|
|
6988
|
+
"9xl": "8rem"
|
|
6989
|
+
};
|
|
6990
|
+
for (const [key, value] of Object.entries(twFontSize)) {
|
|
6991
|
+
css += ` --tw-text-${key}: ${value};
|
|
7342
6992
|
`;
|
|
7343
|
-
|
|
6993
|
+
}
|
|
6994
|
+
const twLeading = {
|
|
6995
|
+
"xs": "1rem",
|
|
6996
|
+
"sm": "1.25rem",
|
|
6997
|
+
"base": "1.5rem",
|
|
6998
|
+
"lg": "1.75rem",
|
|
6999
|
+
"xl": "1.75rem",
|
|
7000
|
+
"2xl": "2rem",
|
|
7001
|
+
"3xl": "2.25rem",
|
|
7002
|
+
"4xl": "2.5rem",
|
|
7003
|
+
"5xl": "1",
|
|
7004
|
+
"6xl": "1",
|
|
7005
|
+
"7xl": "1",
|
|
7006
|
+
"8xl": "1",
|
|
7007
|
+
"9xl": "1"
|
|
7008
|
+
};
|
|
7009
|
+
for (const [key, value] of Object.entries(twLeading)) {
|
|
7010
|
+
css += ` --tw-leading-${key}: ${value};
|
|
7344
7011
|
`;
|
|
7345
|
-
|
|
7346
|
-
|
|
7347
|
-
|
|
7348
|
-
|
|
7349
|
-
|
|
7350
|
-
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
|
|
7354
|
-
|
|
7355
|
-
|
|
7356
|
-
|
|
7357
|
-
|
|
7358
|
-
|
|
7359
|
-
"8": "2rem",
|
|
7360
|
-
"9": "2.25rem",
|
|
7361
|
-
"10": "2.5rem",
|
|
7362
|
-
"11": "2.75rem",
|
|
7363
|
-
"12": "3rem",
|
|
7364
|
-
"14": "3.5rem",
|
|
7365
|
-
"16": "4rem",
|
|
7366
|
-
"20": "5rem",
|
|
7367
|
-
"24": "6rem",
|
|
7368
|
-
"28": "7rem",
|
|
7369
|
-
"32": "8rem",
|
|
7370
|
-
"36": "9rem",
|
|
7371
|
-
"40": "10rem",
|
|
7372
|
-
"44": "11rem",
|
|
7373
|
-
"48": "12rem",
|
|
7374
|
-
"52": "13rem",
|
|
7375
|
-
"56": "14rem",
|
|
7376
|
-
"60": "15rem",
|
|
7377
|
-
"64": "16rem",
|
|
7378
|
-
"72": "18rem",
|
|
7379
|
-
"80": "20rem",
|
|
7380
|
-
"96": "24rem"
|
|
7381
|
-
};
|
|
7382
|
-
for (const [key, value] of Object.entries(twSpacing)) {
|
|
7383
|
-
css += ` --tw-${key}: ${value};
|
|
7012
|
+
}
|
|
7013
|
+
const twFontWeight = {
|
|
7014
|
+
"thin": "100",
|
|
7015
|
+
"extralight": "200",
|
|
7016
|
+
"light": "300",
|
|
7017
|
+
"normal": "400",
|
|
7018
|
+
"medium": "500",
|
|
7019
|
+
"semibold": "600",
|
|
7020
|
+
"bold": "700",
|
|
7021
|
+
"extrabold": "800",
|
|
7022
|
+
"black": "900"
|
|
7023
|
+
};
|
|
7024
|
+
for (const [key, value] of Object.entries(twFontWeight)) {
|
|
7025
|
+
css += ` --tw-font-${key}: ${value};
|
|
7384
7026
|
`;
|
|
7385
|
-
|
|
7386
|
-
|
|
7387
|
-
|
|
7388
|
-
|
|
7389
|
-
|
|
7390
|
-
|
|
7391
|
-
|
|
7392
|
-
|
|
7393
|
-
|
|
7394
|
-
|
|
7395
|
-
|
|
7027
|
+
}
|
|
7028
|
+
css += "}\n\n";
|
|
7029
|
+
return css;
|
|
7030
|
+
}
|
|
7031
|
+
function generateLayoutRule(token, config) {
|
|
7032
|
+
const { property, value, isArbitrary } = token;
|
|
7033
|
+
if (property === value && layoutMap[property]) {
|
|
7034
|
+
return layoutMap[property];
|
|
7035
|
+
}
|
|
7036
|
+
if (property === "justify") {
|
|
7037
|
+
const justifyMap = {
|
|
7038
|
+
"start": "flex-start",
|
|
7039
|
+
"end": "flex-end",
|
|
7040
|
+
"center": "center",
|
|
7041
|
+
"between": "space-between",
|
|
7042
|
+
"around": "space-around",
|
|
7043
|
+
"evenly": "space-evenly",
|
|
7044
|
+
"stretch": "stretch"
|
|
7396
7045
|
};
|
|
7397
|
-
|
|
7398
|
-
|
|
7399
|
-
|
|
7400
|
-
}
|
|
7401
|
-
|
|
7402
|
-
|
|
7403
|
-
|
|
7404
|
-
|
|
7405
|
-
|
|
7406
|
-
|
|
7407
|
-
"
|
|
7408
|
-
"
|
|
7409
|
-
"
|
|
7046
|
+
return `justify-content: ${justifyMap[value] || value};`;
|
|
7047
|
+
}
|
|
7048
|
+
if (property === "justify-items") {
|
|
7049
|
+
return `justify-items: ${value};`;
|
|
7050
|
+
}
|
|
7051
|
+
if (property === "justify-self") {
|
|
7052
|
+
return `justify-self: ${value};`;
|
|
7053
|
+
}
|
|
7054
|
+
if (property === "content") {
|
|
7055
|
+
const contentMap = {
|
|
7056
|
+
"start": "flex-start",
|
|
7057
|
+
"end": "flex-end",
|
|
7058
|
+
"center": "center",
|
|
7059
|
+
"between": "space-between",
|
|
7060
|
+
"around": "space-around",
|
|
7061
|
+
"evenly": "space-evenly",
|
|
7062
|
+
"stretch": "stretch"
|
|
7410
7063
|
};
|
|
7411
|
-
|
|
7412
|
-
|
|
7413
|
-
|
|
7414
|
-
|
|
7415
|
-
|
|
7416
|
-
"
|
|
7417
|
-
"
|
|
7418
|
-
"
|
|
7419
|
-
"
|
|
7420
|
-
"xl": "1.25rem",
|
|
7421
|
-
"2xl": "1.5rem",
|
|
7422
|
-
"3xl": "1.875rem",
|
|
7423
|
-
"4xl": "2.25rem",
|
|
7424
|
-
"5xl": "3rem",
|
|
7425
|
-
"6xl": "3.75rem",
|
|
7426
|
-
"7xl": "4.5rem",
|
|
7427
|
-
"8xl": "6rem",
|
|
7428
|
-
"9xl": "8rem"
|
|
7064
|
+
return `align-content: ${contentMap[value] || value};`;
|
|
7065
|
+
}
|
|
7066
|
+
if (property === "items") {
|
|
7067
|
+
const itemsMap = {
|
|
7068
|
+
"start": "flex-start",
|
|
7069
|
+
"end": "flex-end",
|
|
7070
|
+
"center": "center",
|
|
7071
|
+
"baseline": "baseline",
|
|
7072
|
+
"stretch": "stretch"
|
|
7429
7073
|
};
|
|
7430
|
-
|
|
7431
|
-
|
|
7432
|
-
|
|
7433
|
-
|
|
7434
|
-
|
|
7435
|
-
"
|
|
7436
|
-
"
|
|
7437
|
-
"
|
|
7438
|
-
"
|
|
7439
|
-
"
|
|
7440
|
-
"2xl": "2rem",
|
|
7441
|
-
"3xl": "2.25rem",
|
|
7442
|
-
"4xl": "2.5rem",
|
|
7443
|
-
"5xl": "1",
|
|
7444
|
-
"6xl": "1",
|
|
7445
|
-
"7xl": "1",
|
|
7446
|
-
"8xl": "1",
|
|
7447
|
-
"9xl": "1"
|
|
7074
|
+
return `align-items: ${itemsMap[value] || value};`;
|
|
7075
|
+
}
|
|
7076
|
+
if (property === "self") {
|
|
7077
|
+
const selfMap = {
|
|
7078
|
+
"auto": "auto",
|
|
7079
|
+
"start": "flex-start",
|
|
7080
|
+
"end": "flex-end",
|
|
7081
|
+
"center": "center",
|
|
7082
|
+
"baseline": "baseline",
|
|
7083
|
+
"stretch": "stretch"
|
|
7448
7084
|
};
|
|
7449
|
-
|
|
7450
|
-
|
|
7451
|
-
|
|
7452
|
-
|
|
7453
|
-
|
|
7454
|
-
"
|
|
7455
|
-
"
|
|
7456
|
-
"
|
|
7457
|
-
"
|
|
7458
|
-
"
|
|
7459
|
-
"
|
|
7460
|
-
"bold": "700",
|
|
7461
|
-
"extrabold": "800",
|
|
7462
|
-
"black": "900"
|
|
7085
|
+
return `align-self: ${selfMap[value] || value};`;
|
|
7086
|
+
}
|
|
7087
|
+
if (property === "place-content") {
|
|
7088
|
+
const placeContentMap = {
|
|
7089
|
+
"start": "start",
|
|
7090
|
+
"end": "end",
|
|
7091
|
+
"center": "center",
|
|
7092
|
+
"between": "space-between",
|
|
7093
|
+
"around": "space-around",
|
|
7094
|
+
"evenly": "space-evenly",
|
|
7095
|
+
"stretch": "stretch"
|
|
7463
7096
|
};
|
|
7464
|
-
|
|
7465
|
-
css += ` --tw-font-${key}: ${value};
|
|
7466
|
-
`;
|
|
7467
|
-
}
|
|
7468
|
-
css += "}\n\n";
|
|
7469
|
-
return css;
|
|
7097
|
+
return `place-content: ${placeContentMap[value] || value};`;
|
|
7470
7098
|
}
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7474
|
-
|
|
7475
|
-
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
}
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
}
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
}
|
|
7497
|
-
|
|
7498
|
-
|
|
7099
|
+
if (property === "place-items") {
|
|
7100
|
+
return `place-items: ${value};`;
|
|
7101
|
+
}
|
|
7102
|
+
if (property === "place-self") {
|
|
7103
|
+
return `place-self: ${value};`;
|
|
7104
|
+
}
|
|
7105
|
+
if (property === "z") {
|
|
7106
|
+
return `z-index: var(--z-${value});`;
|
|
7107
|
+
}
|
|
7108
|
+
if (property === "overflow") {
|
|
7109
|
+
return `overflow: ${value};`;
|
|
7110
|
+
}
|
|
7111
|
+
if (property === "overflow-x") {
|
|
7112
|
+
return `overflow-x: ${value};`;
|
|
7113
|
+
}
|
|
7114
|
+
if (property === "overflow-y") {
|
|
7115
|
+
return `overflow-y: ${value};`;
|
|
7116
|
+
}
|
|
7117
|
+
if (property === "aspect") {
|
|
7118
|
+
const aspectMap = {
|
|
7119
|
+
"square": "1 / 1",
|
|
7120
|
+
"video": "16 / 9",
|
|
7121
|
+
"auto": "auto"
|
|
7122
|
+
};
|
|
7123
|
+
const cssValue = isArbitrary ? value.replace(/_/g, " ") : aspectMap[value] || value;
|
|
7124
|
+
return `aspect-ratio: ${cssValue};`;
|
|
7125
|
+
}
|
|
7126
|
+
if (property === "object") {
|
|
7127
|
+
return `object-fit: ${value};`;
|
|
7128
|
+
}
|
|
7129
|
+
if (property === "object-pos") {
|
|
7130
|
+
const cssValue = isArbitrary ? value.replace(/_/g, " ") : value;
|
|
7131
|
+
return `object-position: ${cssValue};`;
|
|
7132
|
+
}
|
|
7133
|
+
const positioningPercentages = {
|
|
7134
|
+
"full": "100%",
|
|
7135
|
+
"half": "50%",
|
|
7136
|
+
"third": "33.333333%",
|
|
7137
|
+
"third-2x": "66.666667%",
|
|
7138
|
+
"quarter": "25%",
|
|
7139
|
+
"quarter-2x": "50%",
|
|
7140
|
+
"quarter-3x": "75%",
|
|
7141
|
+
// Keep fractional values for backwards compatibility
|
|
7142
|
+
"1/1": "100%",
|
|
7143
|
+
"1/2": "50%",
|
|
7144
|
+
"1/3": "33.333333%",
|
|
7145
|
+
"2/3": "66.666667%",
|
|
7146
|
+
"1/4": "25%",
|
|
7147
|
+
"2/4": "50%",
|
|
7148
|
+
"3/4": "75%"
|
|
7149
|
+
};
|
|
7150
|
+
const resolvePositioningValue = (val, arb) => {
|
|
7151
|
+
if (arb) return val;
|
|
7152
|
+
if (val === "0") return "0";
|
|
7153
|
+
if (val.startsWith("-")) {
|
|
7154
|
+
const positiveVal = val.substring(1);
|
|
7155
|
+
if (positioningPercentages[positiveVal]) {
|
|
7156
|
+
return `-${positioningPercentages[positiveVal]}`;
|
|
7157
|
+
}
|
|
7499
7158
|
}
|
|
7500
|
-
if (
|
|
7501
|
-
|
|
7502
|
-
"start": "flex-start",
|
|
7503
|
-
"end": "flex-end",
|
|
7504
|
-
"center": "center",
|
|
7505
|
-
"between": "space-between",
|
|
7506
|
-
"around": "space-around",
|
|
7507
|
-
"evenly": "space-evenly",
|
|
7508
|
-
"stretch": "stretch"
|
|
7509
|
-
};
|
|
7510
|
-
return `align-content: ${contentMap[value] || value};`;
|
|
7159
|
+
if (positioningPercentages[val]) {
|
|
7160
|
+
return positioningPercentages[val];
|
|
7511
7161
|
}
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
|
|
7520
|
-
|
|
7162
|
+
return `var(--s-${val})`;
|
|
7163
|
+
};
|
|
7164
|
+
if (property === "inset") {
|
|
7165
|
+
const cssValue = resolvePositioningValue(value, isArbitrary);
|
|
7166
|
+
return `inset: ${cssValue};`;
|
|
7167
|
+
}
|
|
7168
|
+
if (["top", "right", "bottom", "left"].includes(property)) {
|
|
7169
|
+
const cssValue = resolvePositioningValue(value, isArbitrary);
|
|
7170
|
+
return `${property}: ${cssValue};`;
|
|
7171
|
+
}
|
|
7172
|
+
if (property === "inset-x") {
|
|
7173
|
+
const cssValue = resolvePositioningValue(value, isArbitrary);
|
|
7174
|
+
return `left: ${cssValue}; right: ${cssValue};`;
|
|
7175
|
+
}
|
|
7176
|
+
if (property === "inset-y") {
|
|
7177
|
+
const cssValue = resolvePositioningValue(value, isArbitrary);
|
|
7178
|
+
return `top: ${cssValue}; bottom: ${cssValue};`;
|
|
7179
|
+
}
|
|
7180
|
+
if (property === "cols") {
|
|
7181
|
+
return `columns: ${value};`;
|
|
7182
|
+
}
|
|
7183
|
+
if (property === "overscroll") {
|
|
7184
|
+
return `overscroll-behavior: ${value};`;
|
|
7185
|
+
}
|
|
7186
|
+
if (property === "overscroll-x") {
|
|
7187
|
+
return `overscroll-behavior-x: ${value};`;
|
|
7188
|
+
}
|
|
7189
|
+
if (property === "overscroll-y") {
|
|
7190
|
+
return `overscroll-behavior-y: ${value};`;
|
|
7191
|
+
}
|
|
7192
|
+
if (property === "basis") {
|
|
7193
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7194
|
+
return `flex-basis: ${cssValue};`;
|
|
7195
|
+
}
|
|
7196
|
+
if (property === "flex") {
|
|
7197
|
+
const flexPresets = {
|
|
7198
|
+
"1": "1 1 0%",
|
|
7199
|
+
"auto": "1 1 auto",
|
|
7200
|
+
"initial": "0 1 auto",
|
|
7201
|
+
"none": "none"
|
|
7202
|
+
};
|
|
7203
|
+
const cssValue = isArbitrary ? value.replace(/_/g, " ") : flexPresets[value] || value;
|
|
7204
|
+
return `flex: ${cssValue};`;
|
|
7205
|
+
}
|
|
7206
|
+
if (property === "order") {
|
|
7207
|
+
const orderPresets = {
|
|
7208
|
+
"first": "-9999",
|
|
7209
|
+
"last": "9999",
|
|
7210
|
+
"none": "0"
|
|
7211
|
+
};
|
|
7212
|
+
const cssValue = orderPresets[value] || value;
|
|
7213
|
+
return `order: ${cssValue};`;
|
|
7214
|
+
}
|
|
7215
|
+
if (property === "grid-cols") {
|
|
7216
|
+
if (value === "none") {
|
|
7217
|
+
return "grid-template-columns: none;";
|
|
7521
7218
|
}
|
|
7522
|
-
if (
|
|
7523
|
-
|
|
7524
|
-
"auto": "auto",
|
|
7525
|
-
"start": "flex-start",
|
|
7526
|
-
"end": "flex-end",
|
|
7527
|
-
"center": "center",
|
|
7528
|
-
"baseline": "baseline",
|
|
7529
|
-
"stretch": "stretch"
|
|
7530
|
-
};
|
|
7531
|
-
return `align-self: ${selfMap[value] || value};`;
|
|
7219
|
+
if (value === "subgrid") {
|
|
7220
|
+
return "grid-template-columns: subgrid;";
|
|
7532
7221
|
}
|
|
7533
|
-
if (
|
|
7534
|
-
const
|
|
7535
|
-
|
|
7536
|
-
"end": "end",
|
|
7537
|
-
"center": "center",
|
|
7538
|
-
"between": "space-between",
|
|
7539
|
-
"around": "space-around",
|
|
7540
|
-
"evenly": "space-evenly",
|
|
7541
|
-
"stretch": "stretch"
|
|
7542
|
-
};
|
|
7543
|
-
return `place-content: ${placeContentMap[value] || value};`;
|
|
7222
|
+
if (isArbitrary) {
|
|
7223
|
+
const sanitized = sanitizeArbitraryValue(value);
|
|
7224
|
+
return `grid-template-columns: ${sanitized.replace(/_/g, " ")};`;
|
|
7544
7225
|
}
|
|
7545
|
-
|
|
7546
|
-
|
|
7226
|
+
return `grid-template-columns: repeat(${value}, minmax(0, 1fr));`;
|
|
7227
|
+
}
|
|
7228
|
+
if (property === "grid-rows") {
|
|
7229
|
+
if (value === "none") {
|
|
7230
|
+
return "grid-template-rows: none;";
|
|
7547
7231
|
}
|
|
7548
|
-
if (
|
|
7549
|
-
return
|
|
7232
|
+
if (value === "subgrid") {
|
|
7233
|
+
return "grid-template-rows: subgrid;";
|
|
7550
7234
|
}
|
|
7551
|
-
if (
|
|
7552
|
-
|
|
7235
|
+
if (isArbitrary) {
|
|
7236
|
+
const sanitized = sanitizeArbitraryValue(value);
|
|
7237
|
+
return `grid-template-rows: ${sanitized.replace(/_/g, " ")};`;
|
|
7553
7238
|
}
|
|
7554
|
-
|
|
7555
|
-
|
|
7239
|
+
return `grid-template-rows: repeat(${value}, minmax(0, 1fr));`;
|
|
7240
|
+
}
|
|
7241
|
+
if (property === "col-span") {
|
|
7242
|
+
if (value === "full") {
|
|
7243
|
+
return "grid-column: 1 / -1;";
|
|
7556
7244
|
}
|
|
7557
|
-
|
|
7558
|
-
|
|
7245
|
+
return `grid-column: span ${value} / span ${value};`;
|
|
7246
|
+
}
|
|
7247
|
+
if (property === "col-start") {
|
|
7248
|
+
return `grid-column-start: ${value};`;
|
|
7249
|
+
}
|
|
7250
|
+
if (property === "col-end") {
|
|
7251
|
+
return `grid-column-end: ${value};`;
|
|
7252
|
+
}
|
|
7253
|
+
if (property === "row-span") {
|
|
7254
|
+
if (value === "full") {
|
|
7255
|
+
return "grid-row: 1 / -1;";
|
|
7559
7256
|
}
|
|
7560
|
-
|
|
7561
|
-
|
|
7257
|
+
return `grid-row: span ${value} / span ${value};`;
|
|
7258
|
+
}
|
|
7259
|
+
if (property === "row-start") {
|
|
7260
|
+
return `grid-row-start: ${value};`;
|
|
7261
|
+
}
|
|
7262
|
+
if (property === "row-end") {
|
|
7263
|
+
return `grid-row-end: ${value};`;
|
|
7264
|
+
}
|
|
7265
|
+
if (property === "auto-cols") {
|
|
7266
|
+
const autoPresets = {
|
|
7267
|
+
"auto": "auto",
|
|
7268
|
+
"min": "min-content",
|
|
7269
|
+
"max": "max-content",
|
|
7270
|
+
"fr": "minmax(0, 1fr)"
|
|
7271
|
+
};
|
|
7272
|
+
const cssValue = isArbitrary ? value : autoPresets[value] || value;
|
|
7273
|
+
return `grid-auto-columns: ${cssValue};`;
|
|
7274
|
+
}
|
|
7275
|
+
if (property === "auto-rows") {
|
|
7276
|
+
const autoPresets = {
|
|
7277
|
+
"auto": "auto",
|
|
7278
|
+
"min": "min-content",
|
|
7279
|
+
"max": "max-content",
|
|
7280
|
+
"fr": "minmax(0, 1fr)"
|
|
7281
|
+
};
|
|
7282
|
+
const cssValue = isArbitrary ? value : autoPresets[value] || value;
|
|
7283
|
+
return `grid-auto-rows: ${cssValue};`;
|
|
7284
|
+
}
|
|
7285
|
+
if (property === "border-spacing") {
|
|
7286
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7287
|
+
return `border-spacing: ${cssValue};`;
|
|
7288
|
+
}
|
|
7289
|
+
if (property === "border-spacing-x") {
|
|
7290
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7291
|
+
return `border-spacing: ${cssValue} 0;`;
|
|
7292
|
+
}
|
|
7293
|
+
if (property === "border-spacing-y") {
|
|
7294
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7295
|
+
return `border-spacing: 0 ${cssValue};`;
|
|
7296
|
+
}
|
|
7297
|
+
return layoutMap[property] || "";
|
|
7298
|
+
}
|
|
7299
|
+
function generateSpaceRule(token, config) {
|
|
7300
|
+
const { property, value, isArbitrary } = token;
|
|
7301
|
+
const sizingSpecialValues = {
|
|
7302
|
+
"min": "min-content",
|
|
7303
|
+
"max": "max-content",
|
|
7304
|
+
"fit": "fit-content"
|
|
7305
|
+
};
|
|
7306
|
+
const sizingProps = ["w", "h", "min-w", "max-w", "min-h", "max-h"];
|
|
7307
|
+
if (sizingProps.includes(property) && sizingSpecialValues[value]) {
|
|
7308
|
+
const cssVal = sizingSpecialValues[value];
|
|
7309
|
+
const propMap = {
|
|
7310
|
+
"w": `width: ${cssVal};`,
|
|
7311
|
+
"h": `height: ${cssVal};`,
|
|
7312
|
+
"min-w": `min-width: ${cssVal};`,
|
|
7313
|
+
"max-w": `max-width: ${cssVal};`,
|
|
7314
|
+
"min-h": `min-height: ${cssVal};`,
|
|
7315
|
+
"max-h": `max-height: ${cssVal};`
|
|
7316
|
+
};
|
|
7317
|
+
return propMap[property] || "";
|
|
7318
|
+
}
|
|
7319
|
+
const percentageAdjectives = {
|
|
7320
|
+
"full": "100%",
|
|
7321
|
+
"half": "50%",
|
|
7322
|
+
"third": "33.333333%",
|
|
7323
|
+
"third-2x": "66.666667%",
|
|
7324
|
+
"quarter": "25%",
|
|
7325
|
+
"quarter-2x": "50%",
|
|
7326
|
+
"quarter-3x": "75%",
|
|
7327
|
+
// Keep fractional values for backwards compatibility
|
|
7328
|
+
"1/1": "100%",
|
|
7329
|
+
"1/2": "50%",
|
|
7330
|
+
"1/3": "33.333333%",
|
|
7331
|
+
"2/3": "66.666667%",
|
|
7332
|
+
"1/4": "25%",
|
|
7333
|
+
"2/4": "50%",
|
|
7334
|
+
"3/4": "75%"
|
|
7335
|
+
};
|
|
7336
|
+
if (sizingProps.includes(property) && percentageAdjectives[value]) {
|
|
7337
|
+
const cssVal = percentageAdjectives[value];
|
|
7338
|
+
const propMap = {
|
|
7339
|
+
"w": `width: ${cssVal};`,
|
|
7340
|
+
"h": `height: ${cssVal};`,
|
|
7341
|
+
"min-w": `min-width: ${cssVal};`,
|
|
7342
|
+
"max-w": `max-width: ${cssVal};`,
|
|
7343
|
+
"min-h": `min-height: ${cssVal};`,
|
|
7344
|
+
"max-h": `max-height: ${cssVal};`
|
|
7345
|
+
};
|
|
7346
|
+
return propMap[property] || "";
|
|
7347
|
+
}
|
|
7348
|
+
let cssValue;
|
|
7349
|
+
if (isArbitrary) {
|
|
7350
|
+
cssValue = value;
|
|
7351
|
+
} else {
|
|
7352
|
+
const isNegative = value.startsWith("-");
|
|
7353
|
+
const cleanValue = isNegative ? value.substring(1) : value;
|
|
7354
|
+
let baseValue;
|
|
7355
|
+
if (cleanValue.startsWith("tw-")) {
|
|
7356
|
+
const twValue = cleanValue.slice(3);
|
|
7357
|
+
baseValue = `var(--tw-${twValue.replace(/\./g, "\\\\.")})`;
|
|
7358
|
+
} else {
|
|
7359
|
+
baseValue = `var(--s-${cleanValue})`;
|
|
7562
7360
|
}
|
|
7563
|
-
|
|
7564
|
-
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
|
|
7361
|
+
cssValue = isNegative ? `calc(${baseValue} * -1)` : baseValue;
|
|
7362
|
+
}
|
|
7363
|
+
if (value === "auto") {
|
|
7364
|
+
const autoValue = "auto";
|
|
7365
|
+
const propertyMap2 = {
|
|
7366
|
+
"m": `margin: ${autoValue};`,
|
|
7367
|
+
"m-x": `margin-left: ${autoValue}; margin-right: ${autoValue};`,
|
|
7368
|
+
"m-y": `margin-top: ${autoValue}; margin-bottom: ${autoValue};`,
|
|
7369
|
+
"m-t": `margin-top: ${autoValue};`,
|
|
7370
|
+
"m-r": `margin-right: ${autoValue};`,
|
|
7371
|
+
"m-b": `margin-bottom: ${autoValue};`,
|
|
7372
|
+
"m-l": `margin-left: ${autoValue};`
|
|
7373
|
+
};
|
|
7374
|
+
return propertyMap2[property] || "";
|
|
7375
|
+
}
|
|
7376
|
+
const propertyMap = {
|
|
7377
|
+
// Padding
|
|
7378
|
+
"p": `padding: ${cssValue};`,
|
|
7379
|
+
"p-t": `padding-top: ${cssValue};`,
|
|
7380
|
+
"p-r": `padding-right: ${cssValue};`,
|
|
7381
|
+
"p-b": `padding-bottom: ${cssValue};`,
|
|
7382
|
+
"p-l": `padding-left: ${cssValue};`,
|
|
7383
|
+
"p-x": `padding-left: ${cssValue}; padding-right: ${cssValue};`,
|
|
7384
|
+
"p-y": `padding-top: ${cssValue}; padding-bottom: ${cssValue};`,
|
|
7385
|
+
// Margin
|
|
7386
|
+
"m": `margin: ${cssValue};`,
|
|
7387
|
+
"m-t": `margin-top: ${cssValue};`,
|
|
7388
|
+
"m-r": `margin-right: ${cssValue};`,
|
|
7389
|
+
"m-b": `margin-bottom: ${cssValue};`,
|
|
7390
|
+
"m-l": `margin-left: ${cssValue};`,
|
|
7391
|
+
"m-x": `margin-left: ${cssValue}; margin-right: ${cssValue};`,
|
|
7392
|
+
"m-y": `margin-top: ${cssValue}; margin-bottom: ${cssValue};`,
|
|
7393
|
+
// Gap
|
|
7394
|
+
"g": `gap: ${cssValue};`,
|
|
7395
|
+
"g-x": `column-gap: ${cssValue};`,
|
|
7396
|
+
"g-y": `row-gap: ${cssValue};`,
|
|
7397
|
+
// Sizing
|
|
7398
|
+
"w": `width: ${cssValue};`,
|
|
7399
|
+
"h": `height: ${cssValue};`,
|
|
7400
|
+
"min-w": `min-width: ${cssValue};`,
|
|
7401
|
+
"max-w": `max-width: ${cssValue};`,
|
|
7402
|
+
"min-h": `min-height: ${cssValue};`,
|
|
7403
|
+
"max-h": `max-height: ${cssValue};`
|
|
7404
|
+
};
|
|
7405
|
+
return propertyMap[property] || "";
|
|
7406
|
+
}
|
|
7407
|
+
function generateVisualRule(token, config) {
|
|
7408
|
+
const { property, value, isArbitrary } = token;
|
|
7409
|
+
if (typographyKeywords2[property]) {
|
|
7410
|
+
return typographyKeywords2[property];
|
|
7411
|
+
}
|
|
7412
|
+
const rules = {
|
|
7413
|
+
// Background Color
|
|
7414
|
+
"bg": () => {
|
|
7415
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7416
|
+
return `background-color: ${cssValue};`;
|
|
7417
|
+
},
|
|
7418
|
+
// Background Image
|
|
7419
|
+
"bg-image": () => {
|
|
7420
|
+
if (value === "none") return "background-image: none;";
|
|
7421
|
+
if (value.startsWith("gradient-to-")) {
|
|
7422
|
+
const directionMap = {
|
|
7423
|
+
"t": "to top",
|
|
7424
|
+
"tr": "to top right",
|
|
7425
|
+
"r": "to right",
|
|
7426
|
+
"br": "to bottom right",
|
|
7427
|
+
"b": "to bottom",
|
|
7428
|
+
"bl": "to bottom left",
|
|
7429
|
+
"l": "to left",
|
|
7430
|
+
"tl": "to top left"
|
|
7431
|
+
};
|
|
7432
|
+
const directionCode = value.replace("gradient-to-", "");
|
|
7433
|
+
const direction = directionMap[directionCode];
|
|
7434
|
+
if (direction) {
|
|
7435
|
+
return `background-image: linear-gradient(${direction}, var(--ss-gradient-stops, transparent));`;
|
|
7436
|
+
}
|
|
7437
|
+
}
|
|
7438
|
+
const cssValue = isArbitrary ? sanitizeArbitraryValue(`url(${value})`) : `url(${value})`;
|
|
7439
|
+
return `background-image: ${cssValue};`;
|
|
7440
|
+
},
|
|
7441
|
+
// Background Attachment
|
|
7442
|
+
"bg-attachment": () => {
|
|
7443
|
+
return `background-attachment: ${value};`;
|
|
7444
|
+
},
|
|
7445
|
+
// Background Clip
|
|
7446
|
+
"bg-clip": () => {
|
|
7447
|
+
const clipMap = {
|
|
7448
|
+
"border": "border-box",
|
|
7449
|
+
"padding": "padding-box",
|
|
7450
|
+
"content": "content-box",
|
|
7451
|
+
"text": "text"
|
|
7568
7452
|
};
|
|
7569
|
-
const cssValue =
|
|
7570
|
-
return `
|
|
7571
|
-
}
|
|
7572
|
-
|
|
7573
|
-
|
|
7574
|
-
|
|
7575
|
-
|
|
7576
|
-
|
|
7577
|
-
|
|
7578
|
-
|
|
7579
|
-
|
|
7580
|
-
|
|
7581
|
-
|
|
7582
|
-
|
|
7583
|
-
|
|
7584
|
-
const
|
|
7585
|
-
|
|
7586
|
-
|
|
7587
|
-
|
|
7588
|
-
|
|
7589
|
-
|
|
7590
|
-
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
}
|
|
7595
|
-
if (property === "cols") {
|
|
7596
|
-
return `columns: ${value};`;
|
|
7597
|
-
}
|
|
7598
|
-
if (property === "overscroll") {
|
|
7599
|
-
return `overscroll-behavior: ${value};`;
|
|
7600
|
-
}
|
|
7601
|
-
if (property === "overscroll-x") {
|
|
7602
|
-
return `overscroll-behavior-x: ${value};`;
|
|
7603
|
-
}
|
|
7604
|
-
if (property === "overscroll-y") {
|
|
7605
|
-
return `overscroll-behavior-y: ${value};`;
|
|
7606
|
-
}
|
|
7607
|
-
if (property === "basis") {
|
|
7608
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7609
|
-
return `flex-basis: ${cssValue};`;
|
|
7610
|
-
}
|
|
7611
|
-
if (property === "flex") {
|
|
7612
|
-
const flexPresets = {
|
|
7613
|
-
"1": "1 1 0%",
|
|
7614
|
-
"auto": "1 1 auto",
|
|
7615
|
-
"initial": "0 1 auto",
|
|
7616
|
-
"none": "none"
|
|
7453
|
+
const cssValue = clipMap[value] || value;
|
|
7454
|
+
return `background-clip: ${cssValue};`;
|
|
7455
|
+
},
|
|
7456
|
+
// Background Origin
|
|
7457
|
+
"bg-origin": () => {
|
|
7458
|
+
const originMap = {
|
|
7459
|
+
"border": "border-box",
|
|
7460
|
+
"padding": "padding-box",
|
|
7461
|
+
"content": "content-box"
|
|
7462
|
+
};
|
|
7463
|
+
const cssValue = originMap[value] || value;
|
|
7464
|
+
return `background-origin: ${cssValue};`;
|
|
7465
|
+
},
|
|
7466
|
+
// Background Position
|
|
7467
|
+
"bg-position": () => {
|
|
7468
|
+
const positionMap = {
|
|
7469
|
+
"center": "center",
|
|
7470
|
+
"top": "top",
|
|
7471
|
+
"bottom": "bottom",
|
|
7472
|
+
"left": "left",
|
|
7473
|
+
"right": "right",
|
|
7474
|
+
"top-left": "top left",
|
|
7475
|
+
"top-right": "top right",
|
|
7476
|
+
"bottom-left": "bottom left",
|
|
7477
|
+
"bottom-right": "bottom right"
|
|
7617
7478
|
};
|
|
7618
|
-
const cssValue = isArbitrary ? value.replace(/_/g, " ") :
|
|
7619
|
-
return `
|
|
7620
|
-
}
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
"
|
|
7625
|
-
"
|
|
7479
|
+
const cssValue = isArbitrary ? value.replace(/_/g, " ") : positionMap[value] || value;
|
|
7480
|
+
return `background-position: ${cssValue};`;
|
|
7481
|
+
},
|
|
7482
|
+
// Background Repeat
|
|
7483
|
+
"bg-repeat": () => {
|
|
7484
|
+
const repeatMap = {
|
|
7485
|
+
"repeat": "repeat",
|
|
7486
|
+
"no-repeat": "no-repeat",
|
|
7487
|
+
"repeat-x": "repeat-x",
|
|
7488
|
+
"repeat-y": "repeat-y",
|
|
7489
|
+
"round": "round",
|
|
7490
|
+
"space": "space"
|
|
7626
7491
|
};
|
|
7627
|
-
const cssValue =
|
|
7628
|
-
return `
|
|
7629
|
-
}
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7492
|
+
const cssValue = repeatMap[value] || value;
|
|
7493
|
+
return `background-repeat: ${cssValue};`;
|
|
7494
|
+
},
|
|
7495
|
+
// Background Size
|
|
7496
|
+
"bg-size": () => {
|
|
7497
|
+
const sizeMap = {
|
|
7498
|
+
"auto": "auto",
|
|
7499
|
+
"cover": "cover",
|
|
7500
|
+
"contain": "contain"
|
|
7501
|
+
};
|
|
7502
|
+
const cssValue = isArbitrary ? value.replace(/_/g, " ") : sizeMap[value] || value;
|
|
7503
|
+
return `background-size: ${cssValue};`;
|
|
7504
|
+
},
|
|
7505
|
+
// Background Blend Mode
|
|
7506
|
+
"bg-blend": () => {
|
|
7507
|
+
return `background-blend-mode: ${value};`;
|
|
7508
|
+
},
|
|
7509
|
+
// Gradient Color Stops
|
|
7510
|
+
"from": () => {
|
|
7511
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7512
|
+
return `--ss-gradient-from: ${cssValue}; --ss-gradient-to: rgb(255 255 255 / 0); --ss-gradient-stops: var(--ss-gradient-from), var(--ss-gradient-to);`;
|
|
7513
|
+
},
|
|
7514
|
+
"via": () => {
|
|
7515
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7516
|
+
return `--ss-gradient-to: rgb(255 255 255 / 0); --ss-gradient-stops: var(--ss-gradient-from), ${cssValue}, var(--ss-gradient-to);`;
|
|
7517
|
+
},
|
|
7518
|
+
"to": () => {
|
|
7519
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7520
|
+
return `--ss-gradient-to: ${cssValue};`;
|
|
7521
|
+
},
|
|
7522
|
+
// Text color
|
|
7523
|
+
"text": () => {
|
|
7524
|
+
if (["left", "center", "right", "justify"].includes(value)) {
|
|
7525
|
+
return `text-align: ${value};`;
|
|
7636
7526
|
}
|
|
7527
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7528
|
+
return `color: ${cssValue};`;
|
|
7529
|
+
},
|
|
7530
|
+
// Text Shadow
|
|
7531
|
+
"text-shadow": () => {
|
|
7532
|
+
const shadowPresets = {
|
|
7533
|
+
"none": "none",
|
|
7534
|
+
"small": "0 1px 2px rgba(0,0,0,0.1)",
|
|
7535
|
+
"medium": "0 2px 4px rgba(0,0,0,0.15)",
|
|
7536
|
+
"big": "0 4px 8px rgba(0,0,0,0.2)"
|
|
7537
|
+
};
|
|
7538
|
+
const cssValue = isArbitrary ? value.replace(/_/g, " ") : shadowPresets[value] || value;
|
|
7539
|
+
return `text-shadow: ${cssValue};`;
|
|
7540
|
+
},
|
|
7541
|
+
// Font size (with paired line-height)
|
|
7542
|
+
"text-size": () => {
|
|
7543
|
+
let cssValue;
|
|
7544
|
+
let lineHeightValue;
|
|
7637
7545
|
if (isArbitrary) {
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7546
|
+
cssValue = value;
|
|
7547
|
+
return `font-size: ${cssValue};`;
|
|
7548
|
+
} else if (value.startsWith("tw-")) {
|
|
7549
|
+
const twValue = value.slice(3);
|
|
7550
|
+
cssValue = `var(--tw-text-${twValue})`;
|
|
7551
|
+
lineHeightValue = `var(--tw-leading-${twValue})`;
|
|
7552
|
+
} else {
|
|
7553
|
+
cssValue = `var(--font-${value})`;
|
|
7554
|
+
lineHeightValue = `var(--font-lh-${value})`;
|
|
7645
7555
|
}
|
|
7646
|
-
|
|
7647
|
-
|
|
7556
|
+
return `font-size: ${cssValue}; line-height: ${lineHeightValue};`;
|
|
7557
|
+
},
|
|
7558
|
+
// Font weight / family
|
|
7559
|
+
"font": () => {
|
|
7560
|
+
const fontFamilies = {
|
|
7561
|
+
"sans": "ui-sans-serif, system-ui, sans-serif",
|
|
7562
|
+
"serif": "ui-serif, Georgia, serif",
|
|
7563
|
+
"mono": "ui-monospace, monospace"
|
|
7564
|
+
};
|
|
7565
|
+
if (fontFamilies[value]) {
|
|
7566
|
+
return `font-family: ${fontFamilies[value]};`;
|
|
7648
7567
|
}
|
|
7568
|
+
let cssValue;
|
|
7649
7569
|
if (isArbitrary) {
|
|
7650
|
-
|
|
7651
|
-
}
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
return "grid-column: 1 / -1;";
|
|
7657
|
-
}
|
|
7658
|
-
return `grid-column: span ${value} / span ${value};`;
|
|
7659
|
-
}
|
|
7660
|
-
if (property === "col-start") {
|
|
7661
|
-
return `grid-column-start: ${value};`;
|
|
7662
|
-
}
|
|
7663
|
-
if (property === "col-end") {
|
|
7664
|
-
return `grid-column-end: ${value};`;
|
|
7665
|
-
}
|
|
7666
|
-
if (property === "row-span") {
|
|
7667
|
-
if (value === "full") {
|
|
7668
|
-
return "grid-row: 1 / -1;";
|
|
7570
|
+
cssValue = value;
|
|
7571
|
+
} else if (value.startsWith("tw-")) {
|
|
7572
|
+
const twValue = value.slice(3);
|
|
7573
|
+
cssValue = `var(--tw-font-${twValue})`;
|
|
7574
|
+
} else {
|
|
7575
|
+
cssValue = `var(--fw-${value})`;
|
|
7669
7576
|
}
|
|
7670
|
-
return `
|
|
7671
|
-
}
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
"
|
|
7681
|
-
"min": "min-content",
|
|
7682
|
-
"max": "max-content",
|
|
7683
|
-
"fr": "minmax(0, 1fr)"
|
|
7577
|
+
return `font-weight: ${cssValue};`;
|
|
7578
|
+
},
|
|
7579
|
+
// Letter spacing
|
|
7580
|
+
"tracking": () => {
|
|
7581
|
+
const trackingScale = {
|
|
7582
|
+
"tighter": "-0.05em",
|
|
7583
|
+
"tight": "-0.025em",
|
|
7584
|
+
"normal": "0",
|
|
7585
|
+
"wide": "0.025em",
|
|
7586
|
+
"wider": "0.05em",
|
|
7587
|
+
"widest": "0.1em"
|
|
7684
7588
|
};
|
|
7685
|
-
const cssValue = isArbitrary ? value :
|
|
7686
|
-
return `
|
|
7687
|
-
}
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
"
|
|
7692
|
-
"
|
|
7693
|
-
"
|
|
7589
|
+
const cssValue = isArbitrary ? value : trackingScale[value] || value;
|
|
7590
|
+
return `letter-spacing: ${cssValue};`;
|
|
7591
|
+
},
|
|
7592
|
+
// Line height
|
|
7593
|
+
"leading": () => {
|
|
7594
|
+
const leadingScale = {
|
|
7595
|
+
"none": "1",
|
|
7596
|
+
"tight": "1.25",
|
|
7597
|
+
"snug": "1.375",
|
|
7598
|
+
"normal": "1.5",
|
|
7599
|
+
"relaxed": "1.625",
|
|
7600
|
+
"loose": "2"
|
|
7694
7601
|
};
|
|
7695
|
-
const cssValue = isArbitrary ? value :
|
|
7696
|
-
return `
|
|
7697
|
-
}
|
|
7698
|
-
|
|
7699
|
-
|
|
7700
|
-
return `
|
|
7701
|
-
}
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7602
|
+
const cssValue = isArbitrary ? value : leadingScale[value] || value;
|
|
7603
|
+
return `line-height: ${cssValue};`;
|
|
7604
|
+
},
|
|
7605
|
+
// Line clamp
|
|
7606
|
+
"line-clamp": () => {
|
|
7607
|
+
return `overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: ${value};`;
|
|
7608
|
+
},
|
|
7609
|
+
// Text decoration color
|
|
7610
|
+
"decoration": () => {
|
|
7611
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7612
|
+
return `text-decoration-color: ${cssValue};`;
|
|
7613
|
+
},
|
|
7614
|
+
// Text decoration thickness
|
|
7615
|
+
"decoration-thickness": () => {
|
|
7616
|
+
const cssValue = isArbitrary ? value : `${value}px`;
|
|
7617
|
+
return `text-decoration-thickness: ${cssValue};`;
|
|
7618
|
+
},
|
|
7619
|
+
// Underline offset
|
|
7620
|
+
"underline-offset": () => {
|
|
7621
|
+
const cssValue = isArbitrary ? value : `${value}px`;
|
|
7622
|
+
return `text-underline-offset: ${cssValue};`;
|
|
7623
|
+
},
|
|
7624
|
+
// Text indent
|
|
7625
|
+
"indent": () => {
|
|
7706
7626
|
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7707
|
-
return `
|
|
7708
|
-
}
|
|
7709
|
-
|
|
7627
|
+
return `text-indent: ${cssValue};`;
|
|
7628
|
+
},
|
|
7629
|
+
// Border color
|
|
7630
|
+
"border": () => {
|
|
7631
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7632
|
+
return `border-color: ${cssValue}; border-style: solid;`;
|
|
7633
|
+
},
|
|
7634
|
+
// Border color - directional
|
|
7635
|
+
"border-t": () => {
|
|
7636
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7637
|
+
return `border-top-color: ${cssValue}; border-top-style: solid;`;
|
|
7638
|
+
},
|
|
7639
|
+
"border-b": () => {
|
|
7640
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7641
|
+
return `border-bottom-color: ${cssValue}; border-bottom-style: solid;`;
|
|
7642
|
+
},
|
|
7643
|
+
"border-l": () => {
|
|
7644
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7645
|
+
return `border-left-color: ${cssValue}; border-left-style: solid;`;
|
|
7646
|
+
},
|
|
7647
|
+
"border-r": () => {
|
|
7648
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7649
|
+
return `border-right-color: ${cssValue}; border-right-style: solid;`;
|
|
7650
|
+
},
|
|
7651
|
+
"border-x": () => {
|
|
7652
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7653
|
+
return `border-left-color: ${cssValue}; border-right-color: ${cssValue}; border-left-style: solid; border-right-style: solid;`;
|
|
7654
|
+
},
|
|
7655
|
+
"border-y": () => {
|
|
7656
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7657
|
+
return `border-top-color: ${cssValue}; border-bottom-color: ${cssValue}; border-top-style: solid; border-bottom-style: solid;`;
|
|
7658
|
+
},
|
|
7659
|
+
// Border width
|
|
7660
|
+
"border-w": () => {
|
|
7710
7661
|
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7711
|
-
return `border-
|
|
7712
|
-
}
|
|
7713
|
-
|
|
7662
|
+
return `border-width: ${cssValue}; border-style: solid;`;
|
|
7663
|
+
},
|
|
7664
|
+
// Border width - directional
|
|
7665
|
+
"border-t-w": () => {
|
|
7666
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7667
|
+
return `border-top-width: ${cssValue}; border-top-style: solid;`;
|
|
7668
|
+
},
|
|
7669
|
+
"border-b-w": () => {
|
|
7670
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7671
|
+
return `border-bottom-width: ${cssValue}; border-bottom-style: solid;`;
|
|
7672
|
+
},
|
|
7673
|
+
"border-l-w": () => {
|
|
7674
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7675
|
+
return `border-left-width: ${cssValue}; border-left-style: solid;`;
|
|
7676
|
+
},
|
|
7677
|
+
"border-r-w": () => {
|
|
7678
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7679
|
+
return `border-right-width: ${cssValue}; border-right-style: solid;`;
|
|
7680
|
+
},
|
|
7681
|
+
"border-x-w": () => {
|
|
7682
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7683
|
+
return `border-left-width: ${cssValue}; border-right-width: ${cssValue}; border-left-style: solid; border-right-style: solid;`;
|
|
7684
|
+
},
|
|
7685
|
+
"border-y-w": () => {
|
|
7686
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7687
|
+
return `border-top-width: ${cssValue}; border-bottom-width: ${cssValue}; border-top-style: solid; border-bottom-style: solid;`;
|
|
7688
|
+
},
|
|
7689
|
+
// Border style
|
|
7690
|
+
"border-style": () => {
|
|
7691
|
+
return `border-style: ${value};`;
|
|
7692
|
+
},
|
|
7693
|
+
// Border radius
|
|
7694
|
+
"rounded": () => {
|
|
7695
|
+
return `border-radius: var(--r-${value});`;
|
|
7696
|
+
},
|
|
7697
|
+
// =====================
|
|
7698
|
+
// DIVIDE UTILITIES
|
|
7699
|
+
// =====================
|
|
7700
|
+
// Divide color - all sides
|
|
7701
|
+
"divide": () => {
|
|
7702
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7703
|
+
return `border-color: ${cssValue}; border-style: solid;`;
|
|
7704
|
+
},
|
|
7705
|
+
// Divide color - directional
|
|
7706
|
+
"divide-x": () => {
|
|
7707
|
+
if (value === "reverse") {
|
|
7708
|
+
return "--ss-divide-x-reverse: 1;";
|
|
7709
|
+
}
|
|
7710
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7711
|
+
return `border-left-color: ${cssValue}; border-right-color: ${cssValue}; border-left-style: solid; border-right-style: solid;`;
|
|
7712
|
+
},
|
|
7713
|
+
"divide-y": () => {
|
|
7714
|
+
if (value === "reverse") {
|
|
7715
|
+
return "--ss-divide-y-reverse: 1;";
|
|
7716
|
+
}
|
|
7717
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7718
|
+
return `border-top-color: ${cssValue}; border-bottom-color: ${cssValue}; border-top-style: solid; border-bottom-style: solid;`;
|
|
7719
|
+
},
|
|
7720
|
+
// Divide width - all sides
|
|
7721
|
+
"divide-w": () => {
|
|
7722
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7723
|
+
return `border-width: ${cssValue}; border-style: solid;`;
|
|
7724
|
+
},
|
|
7725
|
+
// Divide width - directional
|
|
7726
|
+
"divide-x-w": () => {
|
|
7727
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7728
|
+
return `border-left-width: ${cssValue}; border-right-width: ${cssValue}; border-left-style: solid; border-right-style: solid;`;
|
|
7729
|
+
},
|
|
7730
|
+
"divide-y-w": () => {
|
|
7731
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7732
|
+
return `border-top-width: ${cssValue}; border-bottom-width: ${cssValue}; border-top-style: solid; border-bottom-style: solid;`;
|
|
7733
|
+
},
|
|
7734
|
+
// Divide style
|
|
7735
|
+
"divide-style": () => {
|
|
7736
|
+
return `border-style: ${value};`;
|
|
7737
|
+
},
|
|
7738
|
+
// Outline Width
|
|
7739
|
+
"outline-w": () => {
|
|
7740
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7741
|
+
return `outline-width: ${cssValue};`;
|
|
7742
|
+
},
|
|
7743
|
+
// Outline Color
|
|
7744
|
+
"outline": () => {
|
|
7745
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7746
|
+
return `outline-color: ${cssValue};`;
|
|
7747
|
+
},
|
|
7748
|
+
// Outline Style
|
|
7749
|
+
"outline-style": () => {
|
|
7750
|
+
return `outline-style: ${value};`;
|
|
7751
|
+
},
|
|
7752
|
+
// Outline Offset
|
|
7753
|
+
"outline-offset": () => {
|
|
7754
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7755
|
+
return `outline-offset: ${cssValue};`;
|
|
7756
|
+
},
|
|
7757
|
+
// Ring Width
|
|
7758
|
+
"ring-w": () => {
|
|
7759
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7760
|
+
return `--ss-ring-width: ${cssValue};`;
|
|
7761
|
+
},
|
|
7762
|
+
// Ring Color
|
|
7763
|
+
"ring-color": () => {
|
|
7764
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7765
|
+
return `--ss-ring-color: ${cssValue};`;
|
|
7766
|
+
},
|
|
7767
|
+
// Ring Offset Width
|
|
7768
|
+
"ring-offset": () => {
|
|
7769
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7770
|
+
return `--ss-ring-offset-width: ${cssValue};`;
|
|
7771
|
+
},
|
|
7772
|
+
// Ring Offset Color
|
|
7773
|
+
"ring-offset-color": () => {
|
|
7774
|
+
const cssValue = resolveColorValue(value, isArbitrary);
|
|
7775
|
+
return `--ss-ring-offset-color: ${cssValue};`;
|
|
7776
|
+
},
|
|
7777
|
+
// Ring (Main utility)
|
|
7778
|
+
"ring": () => {
|
|
7779
|
+
if (value === "none") {
|
|
7780
|
+
return "box-shadow: 0 0 #0000;";
|
|
7781
|
+
}
|
|
7782
|
+
const ringPresets = {
|
|
7783
|
+
"thin": "1px",
|
|
7784
|
+
"regular": "2px",
|
|
7785
|
+
"small": "4px",
|
|
7786
|
+
"medium": "6px",
|
|
7787
|
+
"big": "8px"
|
|
7788
|
+
};
|
|
7789
|
+
const width2 = isArbitrary ? value : ringPresets[value] || (parseInt(value) ? `${value}px` : `var(--s-${value})`);
|
|
7790
|
+
return `--ss-ring-width: ${width2}; box-shadow: var(--ss-ring-inset) 0 0 0 calc(var(--ss-ring-width) + var(--ss-ring-offset-width, 0px)) var(--ss-ring-color, currentColor);`;
|
|
7791
|
+
},
|
|
7792
|
+
// Box shadow
|
|
7793
|
+
"shadow": () => {
|
|
7794
|
+
return `box-shadow: var(--shadow-${value});`;
|
|
7795
|
+
},
|
|
7796
|
+
// Opacity
|
|
7797
|
+
"opacity": () => {
|
|
7798
|
+
const numValue = parseInt(value, 10);
|
|
7799
|
+
if (!isNaN(numValue) && numValue >= 0 && numValue <= 100) {
|
|
7800
|
+
return `opacity: ${numValue / 100};`;
|
|
7801
|
+
}
|
|
7802
|
+
return `opacity: ${value};`;
|
|
7803
|
+
},
|
|
7804
|
+
// Mix Blend Mode
|
|
7805
|
+
"mix-blend": () => {
|
|
7806
|
+
return `mix-blend-mode: ${value};`;
|
|
7807
|
+
},
|
|
7808
|
+
// Mask Clip
|
|
7809
|
+
"mask-clip": () => {
|
|
7810
|
+
const clipMap = {
|
|
7811
|
+
"border": "border-box",
|
|
7812
|
+
"padding": "padding-box",
|
|
7813
|
+
"content": "content-box",
|
|
7814
|
+
"text": "text"
|
|
7815
|
+
};
|
|
7816
|
+
const cssValue = clipMap[value] || value;
|
|
7817
|
+
return `mask-clip: ${cssValue};`;
|
|
7818
|
+
},
|
|
7819
|
+
// Mask Composite
|
|
7820
|
+
"mask-composite": () => {
|
|
7821
|
+
return `mask-composite: ${value};`;
|
|
7822
|
+
},
|
|
7823
|
+
// Mask Image
|
|
7824
|
+
"mask-image": () => {
|
|
7825
|
+
const sanitizedUrl = sanitizeArbitraryValue(value);
|
|
7826
|
+
const cssValue = isArbitrary ? `url(${sanitizedUrl})` : `url(${value})`;
|
|
7827
|
+
return `mask-image: ${cssValue};`;
|
|
7828
|
+
},
|
|
7829
|
+
// Mask Mode
|
|
7830
|
+
"mask-mode": () => {
|
|
7831
|
+
return `mask-mode: ${value};`;
|
|
7832
|
+
},
|
|
7833
|
+
// Mask Origin
|
|
7834
|
+
"mask-origin": () => {
|
|
7835
|
+
const originMap = {
|
|
7836
|
+
"border": "border-box",
|
|
7837
|
+
"padding": "padding-box",
|
|
7838
|
+
"content": "content-box"
|
|
7839
|
+
};
|
|
7840
|
+
const cssValue = originMap[value] || value;
|
|
7841
|
+
return `mask-origin: ${cssValue};`;
|
|
7842
|
+
},
|
|
7843
|
+
// Mask Position
|
|
7844
|
+
"mask-position": () => {
|
|
7845
|
+
const positionMap = {
|
|
7846
|
+
"center": "center",
|
|
7847
|
+
"top": "top",
|
|
7848
|
+
"bottom": "bottom",
|
|
7849
|
+
"left": "left",
|
|
7850
|
+
"right": "right",
|
|
7851
|
+
"top-left": "top left",
|
|
7852
|
+
"top-right": "top right",
|
|
7853
|
+
"bottom-left": "bottom left",
|
|
7854
|
+
"bottom-right": "bottom right"
|
|
7855
|
+
};
|
|
7856
|
+
const cssValue = isArbitrary ? value.replace(/_/g, " ") : positionMap[value] || value;
|
|
7857
|
+
return `mask-position: ${cssValue};`;
|
|
7858
|
+
},
|
|
7859
|
+
// Mask Repeat
|
|
7860
|
+
"mask-repeat": () => {
|
|
7861
|
+
const repeatMap = {
|
|
7862
|
+
"repeat": "repeat",
|
|
7863
|
+
"no-repeat": "no-repeat",
|
|
7864
|
+
"repeat-x": "repeat-x",
|
|
7865
|
+
"repeat-y": "repeat-y",
|
|
7866
|
+
"round": "round",
|
|
7867
|
+
"space": "space"
|
|
7868
|
+
};
|
|
7869
|
+
const cssValue = repeatMap[value] || value;
|
|
7870
|
+
return `mask-repeat: ${cssValue};`;
|
|
7871
|
+
},
|
|
7872
|
+
// Mask Size
|
|
7873
|
+
"mask-size": () => {
|
|
7874
|
+
const sizeMap = {
|
|
7875
|
+
"auto": "auto",
|
|
7876
|
+
"cover": "cover",
|
|
7877
|
+
"contain": "contain"
|
|
7878
|
+
};
|
|
7879
|
+
const cssValue = isArbitrary ? value.replace(/_/g, " ") : sizeMap[value] || value;
|
|
7880
|
+
return `mask-size: ${cssValue};`;
|
|
7881
|
+
},
|
|
7882
|
+
// Mask Type
|
|
7883
|
+
"mask-type": () => {
|
|
7884
|
+
return `mask-type: ${value};`;
|
|
7885
|
+
},
|
|
7886
|
+
// Content
|
|
7887
|
+
"content": () => {
|
|
7888
|
+
const sanitizedValue = sanitizeArbitraryValue(value).replace(/"/g, '\\"');
|
|
7889
|
+
return `content: "${sanitizedValue}";`;
|
|
7890
|
+
},
|
|
7891
|
+
// Filter utilities
|
|
7892
|
+
"blur": () => {
|
|
7893
|
+
const blurScale = {
|
|
7894
|
+
"none": "0",
|
|
7895
|
+
"tiny": "2px",
|
|
7896
|
+
"small": "4px",
|
|
7897
|
+
"medium": "8px",
|
|
7898
|
+
"big": "12px",
|
|
7899
|
+
"giant": "24px",
|
|
7900
|
+
"vast": "48px"
|
|
7901
|
+
};
|
|
7902
|
+
const cssValue = isArbitrary ? value : blurScale[value] || blurScale["medium"];
|
|
7903
|
+
return `filter: blur(${cssValue});`;
|
|
7904
|
+
},
|
|
7905
|
+
"brightness": () => {
|
|
7906
|
+
const brightnessScale = {
|
|
7907
|
+
"dim": 0.5,
|
|
7908
|
+
"dark": 0.75,
|
|
7909
|
+
"normal": 1,
|
|
7910
|
+
"bright": 1.25,
|
|
7911
|
+
"vivid": 1.5
|
|
7912
|
+
};
|
|
7913
|
+
const cssValue = isArbitrary ? value : brightnessScale[value] || brightnessScale["normal"];
|
|
7914
|
+
return `filter: brightness(${cssValue});`;
|
|
7915
|
+
},
|
|
7916
|
+
"contrast": () => {
|
|
7917
|
+
const contrastScale = {
|
|
7918
|
+
"low": 0.5,
|
|
7919
|
+
"reduced": 0.75,
|
|
7920
|
+
"normal": 1,
|
|
7921
|
+
"high": 1.25,
|
|
7922
|
+
"max": 1.5
|
|
7923
|
+
};
|
|
7924
|
+
const cssValue = isArbitrary ? value : contrastScale[value] || contrastScale["normal"];
|
|
7925
|
+
return `filter: contrast(${cssValue});`;
|
|
7926
|
+
},
|
|
7927
|
+
"drop-shadow": () => {
|
|
7928
|
+
const shadowPresets = {
|
|
7929
|
+
"none": "none",
|
|
7930
|
+
"tiny": "0 1px 1px rgba(0,0,0,0.05)",
|
|
7931
|
+
"small": "0 1px 2px rgba(0,0,0,0.1), 0 1px 1px rgba(0,0,0,0.06)",
|
|
7932
|
+
"medium": "0 4px 3px rgba(0,0,0,0.07), 0 2px 2px rgba(0,0,0,0.06)",
|
|
7933
|
+
"big": "0 10px 8px rgba(0,0,0,0.04), 0 4px 3px rgba(0,0,0,0.1)",
|
|
7934
|
+
"giant": "0 20px 13px rgba(0,0,0,0.03), 0 8px 5px rgba(0,0,0,0.08)"
|
|
7935
|
+
};
|
|
7936
|
+
const cssValue = isArbitrary ? value.replace(/_/g, " ") : shadowPresets[value] || shadowPresets["medium"];
|
|
7937
|
+
return `filter: drop-shadow(${cssValue});`;
|
|
7938
|
+
},
|
|
7939
|
+
"grayscale": () => {
|
|
7940
|
+
const grayscaleScale = {
|
|
7941
|
+
"none": "0%",
|
|
7942
|
+
"partial": "50%",
|
|
7943
|
+
"full": "100%"
|
|
7944
|
+
};
|
|
7945
|
+
const cssValue = isArbitrary ? value : grayscaleScale[value] || grayscaleScale["full"];
|
|
7946
|
+
return `filter: grayscale(${cssValue});`;
|
|
7947
|
+
},
|
|
7948
|
+
"hue-rotate": () => {
|
|
7949
|
+
const cssValue = isArbitrary ? value : `${value}deg`;
|
|
7950
|
+
return `filter: hue-rotate(${cssValue});`;
|
|
7951
|
+
},
|
|
7952
|
+
"invert": () => {
|
|
7953
|
+
const invertScale = {
|
|
7954
|
+
"none": "0%",
|
|
7955
|
+
"partial": "50%",
|
|
7956
|
+
"full": "100%"
|
|
7957
|
+
};
|
|
7958
|
+
const cssValue = isArbitrary ? value : invertScale[value] || invertScale["full"];
|
|
7959
|
+
return `filter: invert(${cssValue});`;
|
|
7960
|
+
},
|
|
7961
|
+
"saturate": () => {
|
|
7962
|
+
const saturateScale = {
|
|
7963
|
+
"none": 0,
|
|
7964
|
+
"low": 0.5,
|
|
7965
|
+
"normal": 1,
|
|
7966
|
+
"high": 1.5,
|
|
7967
|
+
"vivid": 2
|
|
7968
|
+
};
|
|
7969
|
+
const cssValue = isArbitrary ? value : saturateScale[value] || saturateScale["normal"];
|
|
7970
|
+
return `filter: saturate(${cssValue});`;
|
|
7971
|
+
},
|
|
7972
|
+
"sepia": () => {
|
|
7973
|
+
const sepiaScale = {
|
|
7974
|
+
"none": "0%",
|
|
7975
|
+
"partial": "50%",
|
|
7976
|
+
"full": "100%"
|
|
7977
|
+
};
|
|
7978
|
+
const cssValue = isArbitrary ? value : sepiaScale[value] || sepiaScale["full"];
|
|
7979
|
+
return `filter: sepia(${cssValue});`;
|
|
7980
|
+
},
|
|
7981
|
+
// Backdrop Filter utilities
|
|
7982
|
+
"backdrop-blur": () => {
|
|
7983
|
+
const blurScale = {
|
|
7984
|
+
"none": "0",
|
|
7985
|
+
"tiny": "2px",
|
|
7986
|
+
"small": "4px",
|
|
7987
|
+
"medium": "8px",
|
|
7988
|
+
"big": "12px",
|
|
7989
|
+
"giant": "24px",
|
|
7990
|
+
"vast": "48px"
|
|
7991
|
+
};
|
|
7992
|
+
const cssValue = isArbitrary ? value : blurScale[value] || blurScale["medium"];
|
|
7993
|
+
return `backdrop-filter: blur(${cssValue});`;
|
|
7994
|
+
},
|
|
7995
|
+
"backdrop-brightness": () => {
|
|
7996
|
+
const brightnessScale = {
|
|
7997
|
+
"dim": 0.5,
|
|
7998
|
+
"dark": 0.75,
|
|
7999
|
+
"normal": 1,
|
|
8000
|
+
"bright": 1.25,
|
|
8001
|
+
"vivid": 1.5
|
|
8002
|
+
};
|
|
8003
|
+
const cssValue = isArbitrary ? value : brightnessScale[value] || brightnessScale["normal"];
|
|
8004
|
+
return `backdrop-filter: brightness(${cssValue});`;
|
|
8005
|
+
},
|
|
8006
|
+
"backdrop-contrast": () => {
|
|
8007
|
+
const contrastScale = {
|
|
8008
|
+
"low": 0.5,
|
|
8009
|
+
"reduced": 0.75,
|
|
8010
|
+
"normal": 1,
|
|
8011
|
+
"high": 1.25,
|
|
8012
|
+
"max": 1.5
|
|
8013
|
+
};
|
|
8014
|
+
const cssValue = isArbitrary ? value : contrastScale[value] || contrastScale["normal"];
|
|
8015
|
+
return `backdrop-filter: contrast(${cssValue});`;
|
|
8016
|
+
},
|
|
8017
|
+
"backdrop-grayscale": () => {
|
|
8018
|
+
const grayscaleScale = {
|
|
8019
|
+
"none": "0%",
|
|
8020
|
+
"partial": "50%",
|
|
8021
|
+
"full": "100%"
|
|
8022
|
+
};
|
|
8023
|
+
const cssValue = isArbitrary ? value : grayscaleScale[value] || grayscaleScale["full"];
|
|
8024
|
+
return `backdrop-filter: grayscale(${cssValue});`;
|
|
8025
|
+
},
|
|
8026
|
+
"backdrop-hue-rotate": () => {
|
|
8027
|
+
const cssValue = isArbitrary ? value : `${value}deg`;
|
|
8028
|
+
return `backdrop-filter: hue-rotate(${cssValue});`;
|
|
8029
|
+
},
|
|
8030
|
+
"backdrop-invert": () => {
|
|
8031
|
+
const invertScale = {
|
|
8032
|
+
"none": "0%",
|
|
8033
|
+
"partial": "50%",
|
|
8034
|
+
"full": "100%"
|
|
8035
|
+
};
|
|
8036
|
+
const cssValue = isArbitrary ? value : invertScale[value] || invertScale["full"];
|
|
8037
|
+
return `backdrop-filter: invert(${cssValue});`;
|
|
8038
|
+
},
|
|
8039
|
+
"backdrop-opacity": () => {
|
|
8040
|
+
const opacityScale = {
|
|
8041
|
+
"invisible": 0,
|
|
8042
|
+
"faint": 0.25,
|
|
8043
|
+
"half": 0.5,
|
|
8044
|
+
"visible": 0.75,
|
|
8045
|
+
"solid": 1
|
|
8046
|
+
};
|
|
8047
|
+
const cssValue = isArbitrary ? value : opacityScale[value] || opacityScale["solid"];
|
|
8048
|
+
return `backdrop-filter: opacity(${cssValue});`;
|
|
8049
|
+
},
|
|
8050
|
+
"backdrop-saturate": () => {
|
|
8051
|
+
const saturateScale = {
|
|
8052
|
+
"none": 0,
|
|
8053
|
+
"low": 0.5,
|
|
8054
|
+
"normal": 1,
|
|
8055
|
+
"high": 1.5,
|
|
8056
|
+
"vivid": 2
|
|
8057
|
+
};
|
|
8058
|
+
const cssValue = isArbitrary ? value : saturateScale[value] || saturateScale["normal"];
|
|
8059
|
+
return `backdrop-filter: saturate(${cssValue});`;
|
|
8060
|
+
},
|
|
8061
|
+
"backdrop-sepia": () => {
|
|
8062
|
+
const sepiaScale = {
|
|
8063
|
+
"none": "0%",
|
|
8064
|
+
"partial": "50%",
|
|
8065
|
+
"full": "100%"
|
|
8066
|
+
};
|
|
8067
|
+
const cssValue = isArbitrary ? value : sepiaScale[value] || sepiaScale["full"];
|
|
8068
|
+
return `backdrop-filter: sepia(${cssValue});`;
|
|
8069
|
+
},
|
|
8070
|
+
// =====================
|
|
8071
|
+
// TRANSITION UTILITIES
|
|
8072
|
+
// =====================
|
|
8073
|
+
// Transition Property
|
|
8074
|
+
"transition": () => {
|
|
8075
|
+
const transitionPresets = {
|
|
8076
|
+
"none": "none",
|
|
8077
|
+
"all": "all",
|
|
8078
|
+
"DEFAULT": "color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",
|
|
8079
|
+
"colors": "color, background-color, border-color, text-decoration-color, fill, stroke",
|
|
8080
|
+
"opacity": "opacity",
|
|
8081
|
+
"shadow": "box-shadow",
|
|
8082
|
+
"transform": "transform"
|
|
8083
|
+
};
|
|
8084
|
+
const prop = transitionPresets[value] || transitionPresets["DEFAULT"];
|
|
8085
|
+
return `transition-property: ${prop}; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms;`;
|
|
8086
|
+
},
|
|
8087
|
+
"transition-none": () => {
|
|
8088
|
+
return "transition-property: none;";
|
|
8089
|
+
},
|
|
8090
|
+
// Transition Duration
|
|
8091
|
+
"duration": () => {
|
|
8092
|
+
const durationScale = {
|
|
8093
|
+
"instant": "75ms",
|
|
8094
|
+
"quick": "100ms",
|
|
8095
|
+
"fast": "150ms",
|
|
8096
|
+
"normal": "200ms",
|
|
8097
|
+
"slow": "300ms",
|
|
8098
|
+
"slower": "500ms",
|
|
8099
|
+
"lazy": "700ms"
|
|
8100
|
+
};
|
|
8101
|
+
const cssValue = isArbitrary ? value : durationScale[value] || durationScale["normal"];
|
|
8102
|
+
return `transition-duration: ${cssValue};`;
|
|
8103
|
+
},
|
|
8104
|
+
// Transition Timing Function
|
|
8105
|
+
"ease": () => {
|
|
8106
|
+
const easingMap = {
|
|
8107
|
+
"linear": "linear",
|
|
8108
|
+
"in": "cubic-bezier(0.4, 0, 1, 1)",
|
|
8109
|
+
"out": "cubic-bezier(0, 0, 0.2, 1)",
|
|
8110
|
+
"in-out": "cubic-bezier(0.4, 0, 0.2, 1)"
|
|
8111
|
+
};
|
|
8112
|
+
const cssValue = isArbitrary ? value : easingMap[value] || easingMap["in-out"];
|
|
8113
|
+
return `transition-timing-function: ${cssValue};`;
|
|
8114
|
+
},
|
|
8115
|
+
// Transition Delay
|
|
8116
|
+
"delay": () => {
|
|
8117
|
+
const delayScale = {
|
|
8118
|
+
"instant": "75ms",
|
|
8119
|
+
"quick": "100ms",
|
|
8120
|
+
"fast": "150ms",
|
|
8121
|
+
"normal": "200ms",
|
|
8122
|
+
"slow": "300ms",
|
|
8123
|
+
"slower": "500ms",
|
|
8124
|
+
"lazy": "700ms"
|
|
8125
|
+
};
|
|
8126
|
+
const cssValue = isArbitrary ? value : delayScale[value] || delayScale["normal"];
|
|
8127
|
+
return `transition-delay: ${cssValue};`;
|
|
8128
|
+
},
|
|
8129
|
+
// Transition Behavior
|
|
8130
|
+
"transition-behavior": () => {
|
|
8131
|
+
return `transition-behavior: ${value};`;
|
|
8132
|
+
},
|
|
8133
|
+
// =====================
|
|
8134
|
+
// ANIMATION UTILITIES
|
|
8135
|
+
// =====================
|
|
8136
|
+
"animate": () => {
|
|
8137
|
+
const animationPresets = {
|
|
8138
|
+
"none": "none",
|
|
8139
|
+
"spin": "spin 1s linear infinite",
|
|
8140
|
+
"ping": "ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",
|
|
8141
|
+
"pulse": "pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",
|
|
8142
|
+
"bounce": "bounce 1s infinite"
|
|
8143
|
+
};
|
|
8144
|
+
const cssValue = isArbitrary ? value.replace(/_/g, " ") : animationPresets[value] || value;
|
|
8145
|
+
return `animation: ${cssValue};`;
|
|
8146
|
+
},
|
|
8147
|
+
// Animation Duration
|
|
8148
|
+
"animation-duration": () => {
|
|
8149
|
+
const durationScale = {
|
|
8150
|
+
"instant": "75ms",
|
|
8151
|
+
"quick": "100ms",
|
|
8152
|
+
"fast": "150ms",
|
|
8153
|
+
"normal": "200ms",
|
|
8154
|
+
"slow": "300ms",
|
|
8155
|
+
"slower": "500ms",
|
|
8156
|
+
"lazy": "700ms"
|
|
8157
|
+
};
|
|
8158
|
+
const cssValue = isArbitrary ? value : durationScale[value] || durationScale["normal"];
|
|
8159
|
+
return `animation-duration: ${cssValue};`;
|
|
8160
|
+
},
|
|
8161
|
+
// Animation Delay
|
|
8162
|
+
"animation-delay": () => {
|
|
8163
|
+
const delayScale = {
|
|
8164
|
+
"instant": "75ms",
|
|
8165
|
+
"quick": "100ms",
|
|
8166
|
+
"fast": "150ms",
|
|
8167
|
+
"normal": "200ms",
|
|
8168
|
+
"slow": "300ms",
|
|
8169
|
+
"slower": "500ms",
|
|
8170
|
+
"lazy": "700ms"
|
|
8171
|
+
};
|
|
8172
|
+
const cssValue = isArbitrary ? value : delayScale[value] || delayScale["normal"];
|
|
8173
|
+
return `animation-delay: ${cssValue};`;
|
|
8174
|
+
},
|
|
8175
|
+
// Animation Iteration Count
|
|
8176
|
+
"animation-iteration": () => {
|
|
8177
|
+
return `animation-iteration-count: ${value};`;
|
|
8178
|
+
},
|
|
8179
|
+
// Animation Direction
|
|
8180
|
+
"animation-direction": () => {
|
|
8181
|
+
return `animation-direction: ${value};`;
|
|
8182
|
+
},
|
|
8183
|
+
// Animation Fill Mode
|
|
8184
|
+
"animation-fill": () => {
|
|
8185
|
+
return `animation-fill-mode: ${value};`;
|
|
8186
|
+
},
|
|
8187
|
+
// Animation Play State
|
|
8188
|
+
"animation-play": () => {
|
|
8189
|
+
return `animation-play-state: ${value};`;
|
|
8190
|
+
},
|
|
8191
|
+
// =====================
|
|
8192
|
+
// TRANSFORM UTILITIES
|
|
8193
|
+
// =====================
|
|
8194
|
+
// Scale
|
|
8195
|
+
"scale": () => {
|
|
8196
|
+
const cssValue = isArbitrary ? value : parseInt(value) / 100;
|
|
8197
|
+
return `transform: scale(${cssValue});`;
|
|
8198
|
+
},
|
|
8199
|
+
"scale-x": () => {
|
|
8200
|
+
const cssValue = isArbitrary ? value : parseInt(value) / 100;
|
|
8201
|
+
return `transform: scaleX(${cssValue});`;
|
|
8202
|
+
},
|
|
8203
|
+
"scale-y": () => {
|
|
8204
|
+
const cssValue = isArbitrary ? value : parseInt(value) / 100;
|
|
8205
|
+
return `transform: scaleY(${cssValue});`;
|
|
8206
|
+
},
|
|
8207
|
+
// Rotate
|
|
8208
|
+
"rotate": () => {
|
|
8209
|
+
const cssValue = isArbitrary ? value : `${value}deg`;
|
|
8210
|
+
return `transform: rotate(${cssValue});`;
|
|
8211
|
+
},
|
|
8212
|
+
// Translate
|
|
8213
|
+
"translate-x": () => {
|
|
8214
|
+
const translatePresets = {
|
|
8215
|
+
"full": "100%",
|
|
8216
|
+
"half": "50%",
|
|
8217
|
+
"third": "33.333333%",
|
|
8218
|
+
"third-2x": "66.666667%",
|
|
8219
|
+
"quarter": "25%",
|
|
8220
|
+
"quarter-2x": "50%",
|
|
8221
|
+
"quarter-3x": "75%",
|
|
8222
|
+
// Legacy fraction format (for backward compatibility)
|
|
8223
|
+
"1/2": "50%",
|
|
8224
|
+
"1/3": "33.333333%",
|
|
8225
|
+
"2/3": "66.666667%",
|
|
8226
|
+
"1/4": "25%",
|
|
8227
|
+
"3/4": "75%",
|
|
8228
|
+
// Negatives (prefixed with -)
|
|
8229
|
+
"-full": "-100%",
|
|
8230
|
+
"-half": "-50%",
|
|
8231
|
+
"-third": "-33.333333%",
|
|
8232
|
+
"-third-2x": "-66.666667%",
|
|
8233
|
+
"-quarter": "-25%",
|
|
8234
|
+
"-quarter-2x": "-50%",
|
|
8235
|
+
"-quarter-3x": "-75%",
|
|
8236
|
+
"-1/2": "-50%",
|
|
8237
|
+
"-1/3": "-33.333333%",
|
|
8238
|
+
"-2/3": "-66.666667%",
|
|
8239
|
+
"-1/4": "-25%",
|
|
8240
|
+
"-3/4": "-75%"
|
|
8241
|
+
};
|
|
8242
|
+
const cssValue = isArbitrary ? value : translatePresets[value] || `var(--s-${value})`;
|
|
8243
|
+
return `transform: translateX(${cssValue});`;
|
|
8244
|
+
},
|
|
8245
|
+
"translate-y": () => {
|
|
8246
|
+
const translatePresets = {
|
|
8247
|
+
"full": "100%",
|
|
8248
|
+
"half": "50%",
|
|
8249
|
+
"third": "33.333333%",
|
|
8250
|
+
"third-2x": "66.666667%",
|
|
8251
|
+
"quarter": "25%",
|
|
8252
|
+
"quarter-2x": "50%",
|
|
8253
|
+
"quarter-3x": "75%",
|
|
8254
|
+
// Legacy fraction format (for backward compatibility)
|
|
8255
|
+
"1/2": "50%",
|
|
8256
|
+
"1/3": "33.333333%",
|
|
8257
|
+
"2/3": "66.666667%",
|
|
8258
|
+
"1/4": "25%",
|
|
8259
|
+
"3/4": "75%",
|
|
8260
|
+
// Negatives (prefixed with -)
|
|
8261
|
+
"-full": "-100%",
|
|
8262
|
+
"-half": "-50%",
|
|
8263
|
+
"-third": "-33.333333%",
|
|
8264
|
+
"-third-2x": "-66.666667%",
|
|
8265
|
+
"-quarter": "-25%",
|
|
8266
|
+
"-quarter-2x": "-50%",
|
|
8267
|
+
"-quarter-3x": "-75%",
|
|
8268
|
+
"-1/2": "-50%",
|
|
8269
|
+
"-1/3": "-33.333333%",
|
|
8270
|
+
"-2/3": "-66.666667%",
|
|
8271
|
+
"-1/4": "-25%",
|
|
8272
|
+
"-3/4": "-75%"
|
|
8273
|
+
};
|
|
8274
|
+
const cssValue = isArbitrary ? value : translatePresets[value] || `var(--s-${value})`;
|
|
8275
|
+
return `transform: translateY(${cssValue});`;
|
|
8276
|
+
},
|
|
8277
|
+
// Skew
|
|
8278
|
+
"skew-x": () => {
|
|
8279
|
+
const cssValue = isArbitrary ? value : `${value}deg`;
|
|
8280
|
+
return `transform: skewX(${cssValue});`;
|
|
8281
|
+
},
|
|
8282
|
+
"skew-y": () => {
|
|
8283
|
+
const cssValue = isArbitrary ? value : `${value}deg`;
|
|
8284
|
+
return `transform: skewY(${cssValue});`;
|
|
8285
|
+
},
|
|
8286
|
+
"-skew-x": () => {
|
|
8287
|
+
const cssValue = isArbitrary ? `-${value}` : `-${value}deg`;
|
|
8288
|
+
return `transform: skewX(${cssValue});`;
|
|
8289
|
+
},
|
|
8290
|
+
"-skew-y": () => {
|
|
8291
|
+
const cssValue = isArbitrary ? `-${value}` : `-${value}deg`;
|
|
8292
|
+
return `transform: skewY(${cssValue});`;
|
|
8293
|
+
},
|
|
8294
|
+
// 3D Rotation (Rotate X/Y/Z)
|
|
8295
|
+
"rotate-x": () => {
|
|
8296
|
+
const cssValue = isArbitrary ? value : `${value}deg`;
|
|
8297
|
+
return `transform: rotateX(${cssValue});`;
|
|
8298
|
+
},
|
|
8299
|
+
"rotate-y": () => {
|
|
8300
|
+
const cssValue = isArbitrary ? value : `${value}deg`;
|
|
8301
|
+
return `transform: rotateY(${cssValue});`;
|
|
8302
|
+
},
|
|
8303
|
+
"rotate-z": () => {
|
|
8304
|
+
const cssValue = isArbitrary ? value : `${value}deg`;
|
|
8305
|
+
return `transform: rotateZ(${cssValue});`;
|
|
8306
|
+
},
|
|
8307
|
+
// 3D Translation (Translate Z)
|
|
8308
|
+
"translate-z": () => {
|
|
8309
|
+
const translatePresets = {
|
|
8310
|
+
"near": "50px",
|
|
8311
|
+
"far": "-50px",
|
|
8312
|
+
"0": "0"
|
|
8313
|
+
};
|
|
8314
|
+
const cssValue = isArbitrary ? value : translatePresets[value] || `var(--s-${value})`;
|
|
8315
|
+
return `transform: translateZ(${cssValue});`;
|
|
8316
|
+
},
|
|
8317
|
+
// Transform Origin
|
|
8318
|
+
"origin": () => {
|
|
8319
|
+
const originMap = {
|
|
8320
|
+
"center": "center",
|
|
8321
|
+
"top": "top",
|
|
8322
|
+
"top-right": "top right",
|
|
8323
|
+
"right": "right",
|
|
8324
|
+
"bottom-right": "bottom right",
|
|
8325
|
+
"bottom": "bottom",
|
|
8326
|
+
"bottom-left": "bottom left",
|
|
8327
|
+
"left": "left",
|
|
8328
|
+
"top-left": "top left"
|
|
8329
|
+
};
|
|
8330
|
+
const cssValue = isArbitrary ? value.replace(/_/g, " ") : originMap[value] || value;
|
|
8331
|
+
return `transform-origin: ${cssValue};`;
|
|
8332
|
+
},
|
|
8333
|
+
// Transform Style (for 3D transforms)
|
|
8334
|
+
"transform-style": () => {
|
|
8335
|
+
return `transform-style: ${value};`;
|
|
8336
|
+
},
|
|
8337
|
+
// Backface Visibility
|
|
8338
|
+
"backface": () => {
|
|
8339
|
+
return `backface-visibility: ${value};`;
|
|
8340
|
+
},
|
|
8341
|
+
// Perspective
|
|
8342
|
+
"perspective": () => {
|
|
8343
|
+
const perspectivePresets = {
|
|
8344
|
+
"none": "none",
|
|
8345
|
+
"small": "250px",
|
|
8346
|
+
"medium": "500px",
|
|
8347
|
+
"big": "750px",
|
|
8348
|
+
"giant": "1000px",
|
|
8349
|
+
"vast": "1500px"
|
|
8350
|
+
};
|
|
8351
|
+
const cssValue = isArbitrary ? value : perspectivePresets[value] || perspectivePresets["medium"];
|
|
8352
|
+
return `perspective: ${cssValue};`;
|
|
8353
|
+
},
|
|
8354
|
+
// Perspective Origin
|
|
8355
|
+
"perspective-origin": () => {
|
|
8356
|
+
const originMap = {
|
|
8357
|
+
"center": "center",
|
|
8358
|
+
"top": "top",
|
|
8359
|
+
"top-right": "top right",
|
|
8360
|
+
"right": "right",
|
|
8361
|
+
"bottom-right": "bottom right",
|
|
8362
|
+
"bottom": "bottom",
|
|
8363
|
+
"bottom-left": "bottom left",
|
|
8364
|
+
"left": "left",
|
|
8365
|
+
"top-left": "top left"
|
|
8366
|
+
};
|
|
8367
|
+
const cssValue = isArbitrary ? value.replace(/_/g, " ") : originMap[value] || value;
|
|
8368
|
+
return `perspective-origin: ${cssValue};`;
|
|
8369
|
+
},
|
|
8370
|
+
// =====================
|
|
8371
|
+
// INTERACTIVITY UTILITIES
|
|
8372
|
+
// =====================
|
|
8373
|
+
// Accent Color
|
|
8374
|
+
"accent": () => {
|
|
8375
|
+
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
8376
|
+
return `accent-color: ${cssValue};`;
|
|
8377
|
+
},
|
|
8378
|
+
// Appearance
|
|
8379
|
+
"appearance": () => {
|
|
8380
|
+
return `appearance: ${value};`;
|
|
8381
|
+
},
|
|
8382
|
+
// Caret Color
|
|
8383
|
+
"caret": () => {
|
|
8384
|
+
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
8385
|
+
return `caret-color: ${cssValue};`;
|
|
8386
|
+
},
|
|
8387
|
+
// Color Scheme
|
|
8388
|
+
"color-scheme": () => {
|
|
8389
|
+
return `color-scheme: ${value};`;
|
|
8390
|
+
},
|
|
8391
|
+
// Cursor
|
|
8392
|
+
"cursor": () => {
|
|
8393
|
+
return `cursor: ${value};`;
|
|
8394
|
+
},
|
|
8395
|
+
// Field Sizing
|
|
8396
|
+
"field-sizing": () => {
|
|
8397
|
+
return `field-sizing: ${value};`;
|
|
8398
|
+
},
|
|
8399
|
+
// Pointer Events
|
|
8400
|
+
"pointer-events": () => {
|
|
8401
|
+
return `pointer-events: ${value};`;
|
|
8402
|
+
},
|
|
8403
|
+
// Resize
|
|
8404
|
+
"resize": () => {
|
|
8405
|
+
const resizeMap = {
|
|
8406
|
+
"none": "none",
|
|
8407
|
+
"both": "both",
|
|
8408
|
+
"x": "horizontal",
|
|
8409
|
+
"y": "vertical"
|
|
8410
|
+
};
|
|
8411
|
+
const cssValue = resizeMap[value] || value;
|
|
8412
|
+
return `resize: ${cssValue};`;
|
|
8413
|
+
},
|
|
8414
|
+
// Scroll Behavior
|
|
8415
|
+
"scroll": () => {
|
|
8416
|
+
return `scroll-behavior: ${value};`;
|
|
8417
|
+
},
|
|
8418
|
+
// Scroll Margin
|
|
8419
|
+
"scroll-m": () => {
|
|
8420
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8421
|
+
return `scroll-margin: ${cssValue};`;
|
|
8422
|
+
},
|
|
8423
|
+
"scroll-m-t": () => {
|
|
8424
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8425
|
+
return `scroll-margin-top: ${cssValue};`;
|
|
8426
|
+
},
|
|
8427
|
+
"scroll-m-r": () => {
|
|
8428
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8429
|
+
return `scroll-margin-right: ${cssValue};`;
|
|
8430
|
+
},
|
|
8431
|
+
"scroll-m-b": () => {
|
|
8432
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8433
|
+
return `scroll-margin-bottom: ${cssValue};`;
|
|
8434
|
+
},
|
|
8435
|
+
"scroll-m-l": () => {
|
|
8436
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8437
|
+
return `scroll-margin-left: ${cssValue};`;
|
|
8438
|
+
},
|
|
8439
|
+
"scroll-m-x": () => {
|
|
8440
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8441
|
+
return `scroll-margin-left: ${cssValue}; scroll-margin-right: ${cssValue};`;
|
|
8442
|
+
},
|
|
8443
|
+
"scroll-m-y": () => {
|
|
8444
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8445
|
+
return `scroll-margin-top: ${cssValue}; scroll-margin-bottom: ${cssValue};`;
|
|
8446
|
+
},
|
|
8447
|
+
// Scroll Padding
|
|
8448
|
+
"scroll-p": () => {
|
|
8449
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8450
|
+
return `scroll-padding: ${cssValue};`;
|
|
8451
|
+
},
|
|
8452
|
+
"scroll-p-t": () => {
|
|
8453
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8454
|
+
return `scroll-padding-top: ${cssValue};`;
|
|
8455
|
+
},
|
|
8456
|
+
"scroll-p-r": () => {
|
|
8457
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8458
|
+
return `scroll-padding-right: ${cssValue};`;
|
|
8459
|
+
},
|
|
8460
|
+
"scroll-p-b": () => {
|
|
8461
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8462
|
+
return `scroll-padding-bottom: ${cssValue};`;
|
|
8463
|
+
},
|
|
8464
|
+
"scroll-p-l": () => {
|
|
8465
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8466
|
+
return `scroll-padding-left: ${cssValue};`;
|
|
8467
|
+
},
|
|
8468
|
+
"scroll-p-x": () => {
|
|
7714
8469
|
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7715
|
-
return `
|
|
8470
|
+
return `scroll-padding-left: ${cssValue}; scroll-padding-right: ${cssValue};`;
|
|
8471
|
+
},
|
|
8472
|
+
"scroll-p-y": () => {
|
|
8473
|
+
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8474
|
+
return `scroll-padding-top: ${cssValue}; scroll-padding-bottom: ${cssValue};`;
|
|
8475
|
+
},
|
|
8476
|
+
// Scroll Snap Align
|
|
8477
|
+
"snap-align": () => {
|
|
8478
|
+
return `scroll-snap-align: ${value};`;
|
|
8479
|
+
},
|
|
8480
|
+
// Scroll Snap Stop
|
|
8481
|
+
"snap-stop": () => {
|
|
8482
|
+
return `scroll-snap-stop: ${value};`;
|
|
8483
|
+
},
|
|
8484
|
+
// Scroll Snap Type
|
|
8485
|
+
"snap": () => {
|
|
8486
|
+
const snapMap = {
|
|
8487
|
+
"none": "none",
|
|
8488
|
+
"x": "x mandatory",
|
|
8489
|
+
"x-proximity": "x proximity",
|
|
8490
|
+
"y": "y mandatory",
|
|
8491
|
+
"y-proximity": "y proximity",
|
|
8492
|
+
"both": "both mandatory",
|
|
8493
|
+
"both-proximity": "both proximity"
|
|
8494
|
+
};
|
|
8495
|
+
const cssValue = snapMap[value] || value;
|
|
8496
|
+
return `scroll-snap-type: ${cssValue};`;
|
|
8497
|
+
},
|
|
8498
|
+
// Touch Action
|
|
8499
|
+
"touch": () => {
|
|
8500
|
+
const touchMap = {
|
|
8501
|
+
"auto": "auto",
|
|
8502
|
+
"none": "none",
|
|
8503
|
+
"pan-x": "pan-x",
|
|
8504
|
+
"pan-y": "pan-y",
|
|
8505
|
+
"pan-left": "pan-left",
|
|
8506
|
+
"pan-right": "pan-right",
|
|
8507
|
+
"pan-up": "pan-up",
|
|
8508
|
+
"pan-down": "pan-down",
|
|
8509
|
+
"pinch-zoom": "pinch-zoom",
|
|
8510
|
+
"manipulation": "manipulation"
|
|
8511
|
+
};
|
|
8512
|
+
const cssValue = touchMap[value] || value;
|
|
8513
|
+
return `touch-action: ${cssValue};`;
|
|
8514
|
+
},
|
|
8515
|
+
// User Select
|
|
8516
|
+
"select": () => {
|
|
8517
|
+
return `user-select: ${value};`;
|
|
8518
|
+
},
|
|
8519
|
+
// Will Change
|
|
8520
|
+
"will-change": () => {
|
|
8521
|
+
const willChangeMap = {
|
|
8522
|
+
"auto": "auto",
|
|
8523
|
+
"scroll": "scroll-position",
|
|
8524
|
+
"contents": "contents",
|
|
8525
|
+
"transform": "transform",
|
|
8526
|
+
"opacity": "opacity"
|
|
8527
|
+
};
|
|
8528
|
+
const cssValue = willChangeMap[value] || value;
|
|
8529
|
+
return `will-change: ${cssValue};`;
|
|
8530
|
+
},
|
|
8531
|
+
// =====================
|
|
8532
|
+
// SVG UTILITIES
|
|
8533
|
+
// =====================
|
|
8534
|
+
// Fill
|
|
8535
|
+
"fill": () => {
|
|
8536
|
+
if (value === "none") {
|
|
8537
|
+
return "fill: none;";
|
|
8538
|
+
}
|
|
8539
|
+
if (value === "current") {
|
|
8540
|
+
return "fill: currentColor;";
|
|
8541
|
+
}
|
|
8542
|
+
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
8543
|
+
return `fill: ${cssValue};`;
|
|
8544
|
+
},
|
|
8545
|
+
// Stroke
|
|
8546
|
+
"stroke": () => {
|
|
8547
|
+
if (value === "none") {
|
|
8548
|
+
return "stroke: none;";
|
|
8549
|
+
}
|
|
8550
|
+
if (value === "current") {
|
|
8551
|
+
return "stroke: currentColor;";
|
|
8552
|
+
}
|
|
8553
|
+
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
8554
|
+
return `stroke: ${cssValue};`;
|
|
8555
|
+
},
|
|
8556
|
+
// Stroke Width
|
|
8557
|
+
"stroke-w": () => {
|
|
8558
|
+
const cssValue = isArbitrary ? value : `${value}px`;
|
|
8559
|
+
return `stroke-width: ${cssValue};`;
|
|
8560
|
+
},
|
|
8561
|
+
// =====================
|
|
8562
|
+
// ACCESSIBILITY UTILITIES
|
|
8563
|
+
// =====================
|
|
8564
|
+
// Forced Color Adjust
|
|
8565
|
+
"forced-colors": () => {
|
|
8566
|
+
return `forced-color-adjust: ${value};`;
|
|
7716
8567
|
}
|
|
7717
|
-
|
|
8568
|
+
};
|
|
8569
|
+
const generator = rules[property];
|
|
8570
|
+
return generator ? generator() : "";
|
|
8571
|
+
}
|
|
8572
|
+
function generateRule(token, config, skipDarkWrapper = false, interactIds = /* @__PURE__ */ new Set()) {
|
|
8573
|
+
const { raw, attrType, breakpoint, state } = token;
|
|
8574
|
+
let cssDeclaration = "";
|
|
8575
|
+
switch (attrType) {
|
|
8576
|
+
case "layout":
|
|
8577
|
+
cssDeclaration = generateLayoutRule(token, config);
|
|
8578
|
+
break;
|
|
8579
|
+
case "space":
|
|
8580
|
+
cssDeclaration = generateSpaceRule(token, config);
|
|
8581
|
+
break;
|
|
8582
|
+
case "visual":
|
|
8583
|
+
cssDeclaration = generateVisualRule(token, config);
|
|
8584
|
+
break;
|
|
8585
|
+
}
|
|
8586
|
+
if (!cssDeclaration) return "";
|
|
8587
|
+
const isDivide = raw.startsWith("divide");
|
|
8588
|
+
let selector = "";
|
|
8589
|
+
if (isDivide) {
|
|
8590
|
+
selector = `[${attrType}~="${raw}"] > :not([hidden]) ~ :not([hidden])`;
|
|
8591
|
+
} else {
|
|
8592
|
+
selector = `[${attrType}~="${raw}"]`;
|
|
7718
8593
|
}
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
8594
|
+
if (state && state !== "dark") {
|
|
8595
|
+
if (isDivide) {
|
|
8596
|
+
selector = `[${attrType}~="${raw}"] > :not([hidden]) ~ :not([hidden]):${state}`;
|
|
8597
|
+
} else {
|
|
8598
|
+
const getStateSelector = (s) => {
|
|
8599
|
+
const map = {
|
|
8600
|
+
"expanded": '[aria-expanded="true"]',
|
|
8601
|
+
"selected": '[aria-selected="true"]',
|
|
8602
|
+
"disabled": ":disabled"
|
|
8603
|
+
};
|
|
8604
|
+
return map[s] || `:${s}`;
|
|
7730
8605
|
};
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
const cssValue2 = sizingSpecialValues[value];
|
|
7741
|
-
const propMap = {
|
|
7742
|
-
"w": `width: ${cssValue2};`,
|
|
7743
|
-
"h": `height: ${cssValue2};`,
|
|
7744
|
-
"min-w": `min-width: ${cssValue2};`,
|
|
7745
|
-
"max-w": `max-width: ${cssValue2};`,
|
|
7746
|
-
"min-h": `min-height: ${cssValue2};`,
|
|
7747
|
-
"max-h": `max-height: ${cssValue2};`
|
|
8606
|
+
const selectors = [];
|
|
8607
|
+
selectors.push(`${selector}${getStateSelector(state)}`);
|
|
8608
|
+
const groupTriggers = {
|
|
8609
|
+
"hover": "hoverable",
|
|
8610
|
+
"focus": "focusable",
|
|
8611
|
+
"focus-visible": "focusable",
|
|
8612
|
+
"active": "pressable",
|
|
8613
|
+
"expanded": "expandable",
|
|
8614
|
+
"selected": "selectable"
|
|
7748
8615
|
};
|
|
7749
|
-
|
|
8616
|
+
if (groupTriggers[state]) {
|
|
8617
|
+
const parentAttr = groupTriggers[state];
|
|
8618
|
+
let triggerState = state;
|
|
8619
|
+
if (state === "focus" || state === "focus-visible") triggerState = "focus-within";
|
|
8620
|
+
const triggerSelector = getStateSelector(triggerState);
|
|
8621
|
+
const groupSelector = `[layout~="${parentAttr}"]:not([layout~="disabled"])${triggerSelector} ${selector}`;
|
|
8622
|
+
selectors.push(groupSelector);
|
|
8623
|
+
if (interactIds && interactIds.size > 0) {
|
|
8624
|
+
for (const id of interactIds) {
|
|
8625
|
+
const peerSelector = `[interact~="${id}"]:not([layout~="disabled"])${triggerSelector} ~ [listens~="${id}"]${selector}`;
|
|
8626
|
+
selectors.push(peerSelector);
|
|
8627
|
+
}
|
|
8628
|
+
}
|
|
8629
|
+
}
|
|
8630
|
+
selector = selectors.join(",\n");
|
|
7750
8631
|
}
|
|
7751
|
-
|
|
7752
|
-
|
|
7753
|
-
|
|
8632
|
+
}
|
|
8633
|
+
return `${selector} { ${cssDeclaration} }
|
|
8634
|
+
`;
|
|
8635
|
+
}
|
|
8636
|
+
function getDarkModeSelector(config) {
|
|
8637
|
+
const darkMode = config.darkMode || "media";
|
|
8638
|
+
if (Array.isArray(darkMode)) {
|
|
8639
|
+
return darkMode[1] || ".dark";
|
|
8640
|
+
}
|
|
8641
|
+
if (darkMode === "selector") {
|
|
8642
|
+
return ".dark";
|
|
8643
|
+
}
|
|
8644
|
+
return null;
|
|
8645
|
+
}
|
|
8646
|
+
function generateCSS(tokens, config) {
|
|
8647
|
+
let css = "";
|
|
8648
|
+
css += generateCSSVariables(config);
|
|
8649
|
+
if (config.preflight !== false) {
|
|
8650
|
+
css += generatePreflight(config);
|
|
8651
|
+
}
|
|
8652
|
+
css += `/* SenangStart CSS - Animation Keyframes */
|
|
8653
|
+
@keyframes spin {
|
|
8654
|
+
to { transform: rotate(360deg); }
|
|
8655
|
+
}
|
|
8656
|
+
@keyframes ping {
|
|
8657
|
+
75%, 100% { transform: scale(2); opacity: 0; }
|
|
8658
|
+
}
|
|
8659
|
+
@keyframes pulse {
|
|
8660
|
+
50% { opacity: .5; }
|
|
8661
|
+
}
|
|
8662
|
+
@keyframes bounce {
|
|
8663
|
+
0%, 100% { transform: translateY(-25%); animation-timing-function: cubic-bezier(0.8, 0, 1, 1); }
|
|
8664
|
+
50% { transform: none; animation-timing-function: cubic-bezier(0, 0, 0.2, 1); }
|
|
8665
|
+
}
|
|
8666
|
+
|
|
8667
|
+
/* SenangStart CSS - Utility Classes */
|
|
8668
|
+
`;
|
|
8669
|
+
const baseTokens = [];
|
|
8670
|
+
const darkTokens = [];
|
|
8671
|
+
const breakpointTokens = {};
|
|
8672
|
+
const { screens } = config.theme;
|
|
8673
|
+
for (const bp of Object.keys(screens)) {
|
|
8674
|
+
breakpointTokens[bp] = [];
|
|
8675
|
+
}
|
|
8676
|
+
for (const token of tokens) {
|
|
8677
|
+
if (token.state === "dark") {
|
|
8678
|
+
darkTokens.push(token);
|
|
8679
|
+
} else if (token.breakpoint) {
|
|
8680
|
+
if (!breakpointTokens[token.breakpoint]) {
|
|
8681
|
+
breakpointTokens[token.breakpoint] = [];
|
|
8682
|
+
}
|
|
8683
|
+
breakpointTokens[token.breakpoint].push(token);
|
|
7754
8684
|
} else {
|
|
7755
|
-
|
|
7756
|
-
|
|
7757
|
-
|
|
7758
|
-
|
|
7759
|
-
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
-
|
|
8685
|
+
baseTokens.push(token);
|
|
8686
|
+
}
|
|
8687
|
+
}
|
|
8688
|
+
const interactIds = /* @__PURE__ */ new Set();
|
|
8689
|
+
for (const token of tokens) {
|
|
8690
|
+
if (token.attrType === "interact") {
|
|
8691
|
+
interactIds.add(token.raw);
|
|
8692
|
+
}
|
|
8693
|
+
}
|
|
8694
|
+
const displayProps = ["flex", "grid", "inline-flex", "inline-grid", "block", "inline", "hidden", "contents"];
|
|
8695
|
+
const baseDisplayTokens = /* @__PURE__ */ new Map();
|
|
8696
|
+
for (const token of baseTokens) {
|
|
8697
|
+
if (token.attrType && displayProps.includes(token.property)) {
|
|
8698
|
+
if (!baseDisplayTokens.has(token.attrType)) {
|
|
8699
|
+
baseDisplayTokens.set(token.attrType, /* @__PURE__ */ new Set());
|
|
7763
8700
|
}
|
|
7764
|
-
|
|
7765
|
-
}
|
|
7766
|
-
const map = {
|
|
7767
|
-
"p": `padding: ${cssValue};`,
|
|
7768
|
-
"p-t": `padding-top: ${cssValue};`,
|
|
7769
|
-
"p-r": `padding-right: ${cssValue};`,
|
|
7770
|
-
"p-b": `padding-bottom: ${cssValue};`,
|
|
7771
|
-
"p-l": `padding-left: ${cssValue};`,
|
|
7772
|
-
"p-x": `padding-left: ${cssValue}; padding-right: ${cssValue};`,
|
|
7773
|
-
"p-y": `padding-top: ${cssValue}; padding-bottom: ${cssValue};`,
|
|
7774
|
-
"m": `margin: ${cssValue};`,
|
|
7775
|
-
"m-t": `margin-top: ${cssValue};`,
|
|
7776
|
-
"m-r": `margin-right: ${cssValue};`,
|
|
7777
|
-
"m-b": `margin-bottom: ${cssValue};`,
|
|
7778
|
-
"m-l": `margin-left: ${cssValue};`,
|
|
7779
|
-
"m-x": `margin-left: ${cssValue}; margin-right: ${cssValue};`,
|
|
7780
|
-
"m-y": `margin-top: ${cssValue}; margin-bottom: ${cssValue};`,
|
|
7781
|
-
"g": `gap: ${cssValue};`,
|
|
7782
|
-
"g-x": `column-gap: ${cssValue};`,
|
|
7783
|
-
"g-y": `row-gap: ${cssValue};`,
|
|
7784
|
-
"w": `width: ${cssValue};`,
|
|
7785
|
-
"h": `height: ${cssValue};`,
|
|
7786
|
-
"min-w": `min-width: ${cssValue};`,
|
|
7787
|
-
"max-w": `max-width: ${cssValue};`,
|
|
7788
|
-
"min-h": `min-height: ${cssValue};`,
|
|
7789
|
-
"max-h": `max-height: ${cssValue};`
|
|
7790
|
-
};
|
|
7791
|
-
return map[property] || "";
|
|
8701
|
+
baseDisplayTokens.get(token.attrType).add(token.raw);
|
|
8702
|
+
}
|
|
7792
8703
|
}
|
|
7793
|
-
|
|
7794
|
-
|
|
7795
|
-
|
|
7796
|
-
|
|
7797
|
-
|
|
7798
|
-
|
|
7799
|
-
|
|
7800
|
-
|
|
7801
|
-
|
|
7802
|
-
|
|
7803
|
-
|
|
7804
|
-
|
|
7805
|
-
|
|
7806
|
-
|
|
7807
|
-
|
|
7808
|
-
|
|
7809
|
-
|
|
7810
|
-
|
|
7811
|
-
|
|
7812
|
-
|
|
7813
|
-
"text-size": () => {
|
|
7814
|
-
let cssValue;
|
|
7815
|
-
let lineHeightValue;
|
|
7816
|
-
if (isArbitrary) {
|
|
7817
|
-
cssValue = value;
|
|
7818
|
-
return `font-size: ${cssValue};`;
|
|
7819
|
-
} else if (value.startsWith("tw-")) {
|
|
7820
|
-
const twValue = value.slice(3);
|
|
7821
|
-
cssValue = `var(--tw-text-${twValue})`;
|
|
7822
|
-
lineHeightValue = `var(--tw-leading-${twValue})`;
|
|
7823
|
-
} else {
|
|
7824
|
-
cssValue = `var(--font-${value})`;
|
|
7825
|
-
lineHeightValue = `var(--font-lh-${value})`;
|
|
7826
|
-
}
|
|
7827
|
-
return `font-size: ${cssValue}; line-height: ${lineHeightValue};`;
|
|
7828
|
-
},
|
|
7829
|
-
"font": () => {
|
|
7830
|
-
const fontFamilies = {
|
|
7831
|
-
"sans": "ui-sans-serif, system-ui, sans-serif",
|
|
7832
|
-
"serif": "ui-serif, Georgia, serif",
|
|
7833
|
-
"mono": "ui-monospace, monospace"
|
|
7834
|
-
};
|
|
7835
|
-
if (fontFamilies[value]) {
|
|
7836
|
-
return `font-family: ${fontFamilies[value]};`;
|
|
7837
|
-
}
|
|
7838
|
-
let cssValue;
|
|
7839
|
-
if (isArbitrary) {
|
|
7840
|
-
cssValue = value;
|
|
7841
|
-
} else if (value.startsWith("tw-")) {
|
|
7842
|
-
const twValue = value.slice(3);
|
|
7843
|
-
cssValue = `var(--tw-font-${twValue})`;
|
|
7844
|
-
} else {
|
|
7845
|
-
cssValue = `var(--fw-${value})`;
|
|
7846
|
-
}
|
|
7847
|
-
return `font-weight: ${cssValue};`;
|
|
7848
|
-
},
|
|
7849
|
-
"tracking": () => {
|
|
7850
|
-
const trackingScale = {
|
|
7851
|
-
"tighter": "-0.05em",
|
|
7852
|
-
"tight": "-0.025em",
|
|
7853
|
-
"normal": "0",
|
|
7854
|
-
"wide": "0.025em",
|
|
7855
|
-
"wider": "0.05em",
|
|
7856
|
-
"widest": "0.1em"
|
|
7857
|
-
};
|
|
7858
|
-
const cssValue = isArbitrary ? value : trackingScale[value] || value;
|
|
7859
|
-
return `letter-spacing: ${cssValue};`;
|
|
7860
|
-
},
|
|
7861
|
-
"leading": () => {
|
|
7862
|
-
const leadingScale = {
|
|
7863
|
-
"none": "1",
|
|
7864
|
-
"tight": "1.25",
|
|
7865
|
-
"snug": "1.375",
|
|
7866
|
-
"normal": "1.5",
|
|
7867
|
-
"relaxed": "1.625",
|
|
7868
|
-
"loose": "2"
|
|
7869
|
-
};
|
|
7870
|
-
const cssValue = isArbitrary ? value : leadingScale[value] || value;
|
|
7871
|
-
return `line-height: ${cssValue};`;
|
|
7872
|
-
},
|
|
7873
|
-
"line-clamp": () => {
|
|
7874
|
-
return `overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: ${value};`;
|
|
7875
|
-
},
|
|
7876
|
-
"decoration": () => {
|
|
7877
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
7878
|
-
return `text-decoration-color: ${cssValue};`;
|
|
7879
|
-
},
|
|
7880
|
-
"decoration-thickness": () => {
|
|
7881
|
-
const cssValue = isArbitrary ? value : `${value}px`;
|
|
7882
|
-
return `text-decoration-thickness: ${cssValue};`;
|
|
7883
|
-
},
|
|
7884
|
-
"underline-offset": () => {
|
|
7885
|
-
const cssValue = isArbitrary ? value : `${value}px`;
|
|
7886
|
-
return `text-underline-offset: ${cssValue};`;
|
|
7887
|
-
},
|
|
7888
|
-
"indent": () => {
|
|
7889
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7890
|
-
return `text-indent: ${cssValue};`;
|
|
7891
|
-
},
|
|
7892
|
-
"border": () => {
|
|
7893
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
7894
|
-
return `border-color: ${cssValue}; border-style: solid;`;
|
|
7895
|
-
},
|
|
7896
|
-
// Border color - directional
|
|
7897
|
-
"border-t": () => {
|
|
7898
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
7899
|
-
return `border-top-color: ${cssValue}; border-top-style: solid;`;
|
|
7900
|
-
},
|
|
7901
|
-
"border-b": () => {
|
|
7902
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
7903
|
-
return `border-bottom-color: ${cssValue}; border-bottom-style: solid;`;
|
|
7904
|
-
},
|
|
7905
|
-
"border-l": () => {
|
|
7906
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
7907
|
-
return `border-left-color: ${cssValue}; border-left-style: solid;`;
|
|
7908
|
-
},
|
|
7909
|
-
"border-r": () => {
|
|
7910
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
7911
|
-
return `border-right-color: ${cssValue}; border-right-style: solid;`;
|
|
7912
|
-
},
|
|
7913
|
-
"border-x": () => {
|
|
7914
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
7915
|
-
return `border-left-color: ${cssValue}; border-right-color: ${cssValue}; border-left-style: solid; border-right-style: solid;`;
|
|
7916
|
-
},
|
|
7917
|
-
"border-y": () => {
|
|
7918
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
7919
|
-
return `border-top-color: ${cssValue}; border-bottom-color: ${cssValue}; border-top-style: solid; border-bottom-style: solid;`;
|
|
7920
|
-
},
|
|
7921
|
-
"border-w": () => {
|
|
7922
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7923
|
-
return `border-width: ${cssValue}; border-style: solid;`;
|
|
7924
|
-
},
|
|
7925
|
-
// Border width - directional
|
|
7926
|
-
"border-t-w": () => {
|
|
7927
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7928
|
-
return `border-top-width: ${cssValue}; border-top-style: solid;`;
|
|
7929
|
-
},
|
|
7930
|
-
"border-b-w": () => {
|
|
7931
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7932
|
-
return `border-bottom-width: ${cssValue}; border-bottom-style: solid;`;
|
|
7933
|
-
},
|
|
7934
|
-
"border-l-w": () => {
|
|
7935
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7936
|
-
return `border-left-width: ${cssValue}; border-left-style: solid;`;
|
|
7937
|
-
},
|
|
7938
|
-
"border-r-w": () => {
|
|
7939
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7940
|
-
return `border-right-width: ${cssValue}; border-right-style: solid;`;
|
|
7941
|
-
},
|
|
7942
|
-
"border-x-w": () => {
|
|
7943
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7944
|
-
return `border-left-width: ${cssValue}; border-right-width: ${cssValue}; border-left-style: solid; border-right-style: solid;`;
|
|
7945
|
-
},
|
|
7946
|
-
"border-y-w": () => {
|
|
7947
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
7948
|
-
return `border-top-width: ${cssValue}; border-bottom-width: ${cssValue}; border-top-style: solid; border-bottom-style: solid;`;
|
|
7949
|
-
},
|
|
7950
|
-
"rounded": () => {
|
|
7951
|
-
let cssValue;
|
|
7952
|
-
if (isArbitrary) {
|
|
7953
|
-
cssValue = value;
|
|
7954
|
-
} else if (value.startsWith("tw-")) {
|
|
7955
|
-
const twValue = value.slice(3);
|
|
7956
|
-
cssValue = `var(--tw-rounded-${twValue})`;
|
|
7957
|
-
} else {
|
|
7958
|
-
cssValue = `var(--r-${value})`;
|
|
7959
|
-
}
|
|
7960
|
-
return `border-radius: ${cssValue};`;
|
|
7961
|
-
},
|
|
7962
|
-
"shadow": () => {
|
|
7963
|
-
let cssValue;
|
|
7964
|
-
if (isArbitrary) {
|
|
7965
|
-
cssValue = value;
|
|
7966
|
-
} else if (value.startsWith("tw-")) {
|
|
7967
|
-
const twValue = value.slice(3);
|
|
7968
|
-
cssValue = `var(--tw-shadow-${twValue})`;
|
|
7969
|
-
} else {
|
|
7970
|
-
cssValue = `var(--shadow-${value})`;
|
|
7971
|
-
}
|
|
7972
|
-
return `box-shadow: ${cssValue};`;
|
|
7973
|
-
},
|
|
7974
|
-
"opacity": () => {
|
|
7975
|
-
const opacityValue = isArbitrary ? value : parseFloat(value) / 100;
|
|
7976
|
-
return `opacity: ${opacityValue};`;
|
|
7977
|
-
},
|
|
7978
|
-
"content": () => `content: "${value}";`,
|
|
7979
|
-
// ============================================
|
|
7980
|
-
// TRANSFORM UTILITIES
|
|
7981
|
-
// ============================================
|
|
7982
|
-
"scale": () => {
|
|
7983
|
-
const scaleValue = isArbitrary ? value : parseFloat(value) / 100;
|
|
7984
|
-
return `transform: scale(${scaleValue});`;
|
|
7985
|
-
},
|
|
7986
|
-
"scale-x": () => {
|
|
7987
|
-
const scaleValue = isArbitrary ? value : parseFloat(value) / 100;
|
|
7988
|
-
return `transform: scaleX(${scaleValue});`;
|
|
7989
|
-
},
|
|
7990
|
-
"scale-y": () => {
|
|
7991
|
-
const scaleValue = isArbitrary ? value : parseFloat(value) / 100;
|
|
7992
|
-
return `transform: scaleY(${scaleValue});`;
|
|
7993
|
-
},
|
|
7994
|
-
"rotate": () => {
|
|
7995
|
-
const rotateValue = isArbitrary ? value : `${value}deg`;
|
|
7996
|
-
return `transform: rotate(${rotateValue});`;
|
|
7997
|
-
},
|
|
7998
|
-
"translate-x": () => {
|
|
7999
|
-
const translatePresets = { "0": "0", "full": "100%", "1/2": "50%", "-full": "-100%", "-1/2": "-50%" };
|
|
8000
|
-
const cssValue = isArbitrary ? value : translatePresets[value] || `var(--s-${value})`;
|
|
8001
|
-
return `transform: translateX(${cssValue});`;
|
|
8002
|
-
},
|
|
8003
|
-
"translate-y": () => {
|
|
8004
|
-
const translatePresets = { "0": "0", "full": "100%", "1/2": "50%", "-full": "-100%", "-1/2": "-50%" };
|
|
8005
|
-
const cssValue = isArbitrary ? value : translatePresets[value] || `var(--s-${value})`;
|
|
8006
|
-
return `transform: translateY(${cssValue});`;
|
|
8007
|
-
},
|
|
8008
|
-
"skew-x": () => {
|
|
8009
|
-
const skewValue = isArbitrary ? value : `${value}deg`;
|
|
8010
|
-
return `transform: skewX(${skewValue});`;
|
|
8011
|
-
},
|
|
8012
|
-
"skew-y": () => {
|
|
8013
|
-
const skewValue = isArbitrary ? value : `${value}deg`;
|
|
8014
|
-
return `transform: skewY(${skewValue});`;
|
|
8015
|
-
},
|
|
8016
|
-
"origin": () => {
|
|
8017
|
-
const originMap = {
|
|
8018
|
-
"center": "center",
|
|
8019
|
-
"top": "top",
|
|
8020
|
-
"top-right": "top right",
|
|
8021
|
-
"right": "right",
|
|
8022
|
-
"bottom-right": "bottom right",
|
|
8023
|
-
"bottom": "bottom",
|
|
8024
|
-
"bottom-left": "bottom left",
|
|
8025
|
-
"left": "left",
|
|
8026
|
-
"top-left": "top left"
|
|
8027
|
-
};
|
|
8028
|
-
const cssValue = isArbitrary ? value.replace(/_/g, " ") : originMap[value] || value;
|
|
8029
|
-
return `transform-origin: ${cssValue};`;
|
|
8030
|
-
},
|
|
8031
|
-
// ============================================
|
|
8032
|
-
// TRANSITION UTILITIES
|
|
8033
|
-
// ============================================
|
|
8034
|
-
"transition": () => {
|
|
8035
|
-
const transitionMap = {
|
|
8036
|
-
"none": "transition-property: none;",
|
|
8037
|
-
"all": "transition-property: all; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms;",
|
|
8038
|
-
"colors": "transition-property: color, background-color, border-color; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms;",
|
|
8039
|
-
"opacity": "transition-property: opacity; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms;",
|
|
8040
|
-
"shadow": "transition-property: box-shadow; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms;",
|
|
8041
|
-
"transform": "transition-property: transform; transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1); transition-duration: 150ms;"
|
|
8042
|
-
};
|
|
8043
|
-
return transitionMap[value] || `transition-property: ${value};`;
|
|
8044
|
-
},
|
|
8045
|
-
"duration": () => {
|
|
8046
|
-
const durationMap = {
|
|
8047
|
-
"instant": "75ms",
|
|
8048
|
-
"quick": "100ms",
|
|
8049
|
-
"fast": "150ms",
|
|
8050
|
-
"normal": "200ms",
|
|
8051
|
-
"slow": "300ms",
|
|
8052
|
-
"slower": "500ms",
|
|
8053
|
-
"lazy": "700ms"
|
|
8054
|
-
};
|
|
8055
|
-
const cssValue = isArbitrary ? value : durationMap[value] || `${value}ms`;
|
|
8056
|
-
return `transition-duration: ${cssValue};`;
|
|
8057
|
-
},
|
|
8058
|
-
"ease": () => {
|
|
8059
|
-
const easeMap = {
|
|
8060
|
-
"linear": "linear",
|
|
8061
|
-
"in": "cubic-bezier(0.4, 0, 1, 1)",
|
|
8062
|
-
"out": "cubic-bezier(0, 0, 0.2, 1)",
|
|
8063
|
-
"in-out": "cubic-bezier(0.4, 0, 0.2, 1)"
|
|
8064
|
-
};
|
|
8065
|
-
const cssValue = easeMap[value] || value;
|
|
8066
|
-
return `transition-timing-function: ${cssValue};`;
|
|
8067
|
-
},
|
|
8068
|
-
"delay": () => {
|
|
8069
|
-
const delayMap = {
|
|
8070
|
-
"instant": "75ms",
|
|
8071
|
-
"quick": "100ms",
|
|
8072
|
-
"fast": "150ms",
|
|
8073
|
-
"normal": "200ms",
|
|
8074
|
-
"slow": "300ms"
|
|
8075
|
-
};
|
|
8076
|
-
const cssValue = isArbitrary ? value : delayMap[value] || `${value}ms`;
|
|
8077
|
-
return `transition-delay: ${cssValue};`;
|
|
8078
|
-
},
|
|
8079
|
-
"animate": () => {
|
|
8080
|
-
const animateMap = {
|
|
8081
|
-
"none": "animation: none;",
|
|
8082
|
-
"spin": "animation: spin 1s linear infinite;",
|
|
8083
|
-
"ping": "animation: ping 1s cubic-bezier(0, 0, 0.2, 1) infinite;",
|
|
8084
|
-
"pulse": "animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;",
|
|
8085
|
-
"bounce": "animation: bounce 1s infinite;"
|
|
8086
|
-
};
|
|
8087
|
-
return animateMap[value] || `animation: ${value};`;
|
|
8088
|
-
},
|
|
8089
|
-
// ============================================
|
|
8090
|
-
// FILTER UTILITIES
|
|
8091
|
-
// ============================================
|
|
8092
|
-
"blur": () => {
|
|
8093
|
-
const blurScale = {
|
|
8094
|
-
"none": "0",
|
|
8095
|
-
"sm": "4px",
|
|
8096
|
-
"md": "8px",
|
|
8097
|
-
"lg": "12px",
|
|
8098
|
-
"xl": "16px",
|
|
8099
|
-
"2xl": "24px",
|
|
8100
|
-
"3xl": "40px"
|
|
8101
|
-
};
|
|
8102
|
-
const cssValue = isArbitrary ? value : blurScale[value] || `${value}px`;
|
|
8103
|
-
return `filter: blur(${cssValue});`;
|
|
8104
|
-
},
|
|
8105
|
-
"brightness": () => {
|
|
8106
|
-
const brightnessScale = {
|
|
8107
|
-
"0": "0",
|
|
8108
|
-
"50": "0.5",
|
|
8109
|
-
"75": "0.75",
|
|
8110
|
-
"90": "0.9",
|
|
8111
|
-
"95": "0.95",
|
|
8112
|
-
"100": "1",
|
|
8113
|
-
"105": "1.05",
|
|
8114
|
-
"110": "1.1",
|
|
8115
|
-
"125": "1.25",
|
|
8116
|
-
"150": "1.5",
|
|
8117
|
-
"200": "2"
|
|
8118
|
-
};
|
|
8119
|
-
const cssValue = isArbitrary ? value : brightnessScale[value] || parseFloat(value) / 100;
|
|
8120
|
-
return `filter: brightness(${cssValue});`;
|
|
8121
|
-
},
|
|
8122
|
-
"contrast": () => {
|
|
8123
|
-
const contrastScale = {
|
|
8124
|
-
"0": "0",
|
|
8125
|
-
"50": "0.5",
|
|
8126
|
-
"75": "0.75",
|
|
8127
|
-
"100": "1",
|
|
8128
|
-
"125": "1.25",
|
|
8129
|
-
"150": "1.5",
|
|
8130
|
-
"200": "2"
|
|
8131
|
-
};
|
|
8132
|
-
const cssValue = isArbitrary ? value : contrastScale[value] || parseFloat(value) / 100;
|
|
8133
|
-
return `filter: contrast(${cssValue});`;
|
|
8134
|
-
},
|
|
8135
|
-
"grayscale": () => {
|
|
8136
|
-
const grayscaleScale = { "0": "0", "100": "1", "full": "1" };
|
|
8137
|
-
const cssValue = isArbitrary ? value : grayscaleScale[value] || parseFloat(value) / 100;
|
|
8138
|
-
return `filter: grayscale(${cssValue});`;
|
|
8139
|
-
},
|
|
8140
|
-
"hue-rotate": () => {
|
|
8141
|
-
const cssValue = isArbitrary ? value : `${value}deg`;
|
|
8142
|
-
return `filter: hue-rotate(${cssValue});`;
|
|
8143
|
-
},
|
|
8144
|
-
"invert": () => {
|
|
8145
|
-
const invertScale = { "0": "0", "100": "1", "full": "1" };
|
|
8146
|
-
const cssValue = isArbitrary ? value : invertScale[value] || parseFloat(value) / 100;
|
|
8147
|
-
return `filter: invert(${cssValue});`;
|
|
8148
|
-
},
|
|
8149
|
-
"saturate": () => {
|
|
8150
|
-
const saturateScale = {
|
|
8151
|
-
"0": "0",
|
|
8152
|
-
"50": "0.5",
|
|
8153
|
-
"100": "1",
|
|
8154
|
-
"150": "1.5",
|
|
8155
|
-
"200": "2"
|
|
8156
|
-
};
|
|
8157
|
-
const cssValue = isArbitrary ? value : saturateScale[value] || parseFloat(value) / 100;
|
|
8158
|
-
return `filter: saturate(${cssValue});`;
|
|
8159
|
-
},
|
|
8160
|
-
"sepia": () => {
|
|
8161
|
-
const sepiaScale = { "0": "0", "100": "1", "full": "1" };
|
|
8162
|
-
const cssValue = isArbitrary ? value : sepiaScale[value] || parseFloat(value) / 100;
|
|
8163
|
-
return `filter: sepia(${cssValue});`;
|
|
8164
|
-
},
|
|
8165
|
-
"drop-shadow": () => {
|
|
8166
|
-
const shadowMap = {
|
|
8167
|
-
"sm": "drop-shadow(0 1px 1px rgb(0 0 0 / 0.05))",
|
|
8168
|
-
"md": "drop-shadow(0 4px 3px rgb(0 0 0 / 0.07)) drop-shadow(0 2px 2px rgb(0 0 0 / 0.06))",
|
|
8169
|
-
"lg": "drop-shadow(0 10px 8px rgb(0 0 0 / 0.04)) drop-shadow(0 4px 3px rgb(0 0 0 / 0.1))",
|
|
8170
|
-
"xl": "drop-shadow(0 20px 13px rgb(0 0 0 / 0.03)) drop-shadow(0 8px 5px rgb(0 0 0 / 0.08))",
|
|
8171
|
-
"2xl": "drop-shadow(0 25px 25px rgb(0 0 0 / 0.15))",
|
|
8172
|
-
"none": "drop-shadow(0 0 #0000)"
|
|
8173
|
-
};
|
|
8174
|
-
const cssValue = isArbitrary ? `drop-shadow(${value.replace(/_/g, " ")})` : shadowMap[value] || shadowMap["md"];
|
|
8175
|
-
return `filter: ${cssValue};`;
|
|
8176
|
-
},
|
|
8177
|
-
// ============================================
|
|
8178
|
-
// BACKGROUND UTILITIES
|
|
8179
|
-
// ============================================
|
|
8180
|
-
"bg-size": () => {
|
|
8181
|
-
const sizeMap = { "auto": "auto", "cover": "cover", "contain": "contain" };
|
|
8182
|
-
const cssValue = isArbitrary ? value.replace(/_/g, " ") : sizeMap[value] || value;
|
|
8183
|
-
return `background-size: ${cssValue};`;
|
|
8184
|
-
},
|
|
8185
|
-
"bg-pos": () => {
|
|
8186
|
-
const posMap = {
|
|
8187
|
-
"center": "center",
|
|
8188
|
-
"top": "top",
|
|
8189
|
-
"top-right": "top right",
|
|
8190
|
-
"right": "right",
|
|
8191
|
-
"bottom-right": "bottom right",
|
|
8192
|
-
"bottom": "bottom",
|
|
8193
|
-
"bottom-left": "bottom left",
|
|
8194
|
-
"left": "left",
|
|
8195
|
-
"top-left": "top left"
|
|
8196
|
-
};
|
|
8197
|
-
const cssValue = isArbitrary ? value.replace(/_/g, " ") : posMap[value] || value;
|
|
8198
|
-
return `background-position: ${cssValue};`;
|
|
8199
|
-
},
|
|
8200
|
-
"bg-repeat": () => {
|
|
8201
|
-
const repeatMap = {
|
|
8202
|
-
"repeat": "repeat",
|
|
8203
|
-
"no-repeat": "no-repeat",
|
|
8204
|
-
"repeat-x": "repeat-x",
|
|
8205
|
-
"repeat-y": "repeat-y",
|
|
8206
|
-
"round": "round",
|
|
8207
|
-
"space": "space"
|
|
8208
|
-
};
|
|
8209
|
-
return `background-repeat: ${repeatMap[value] || value};`;
|
|
8210
|
-
},
|
|
8211
|
-
"bg-attachment": () => {
|
|
8212
|
-
return `background-attachment: ${value};`;
|
|
8213
|
-
},
|
|
8214
|
-
"bg-clip": () => {
|
|
8215
|
-
const clipMap = {
|
|
8216
|
-
"border": "border-box",
|
|
8217
|
-
"padding": "padding-box",
|
|
8218
|
-
"content": "content-box",
|
|
8219
|
-
"text": "text"
|
|
8220
|
-
};
|
|
8221
|
-
return `background-clip: ${clipMap[value] || value};`;
|
|
8222
|
-
},
|
|
8223
|
-
"bg-origin": () => {
|
|
8224
|
-
const originMap = {
|
|
8225
|
-
"border": "border-box",
|
|
8226
|
-
"padding": "padding-box",
|
|
8227
|
-
"content": "content-box"
|
|
8228
|
-
};
|
|
8229
|
-
return `background-origin: ${originMap[value] || value};`;
|
|
8230
|
-
},
|
|
8231
|
-
"bg-blend": () => {
|
|
8232
|
-
return `background-blend-mode: ${value};`;
|
|
8233
|
-
},
|
|
8234
|
-
"bg-image": () => {
|
|
8235
|
-
const gradientMap = {
|
|
8236
|
-
"none": "none",
|
|
8237
|
-
"gradient-to-t": "linear-gradient(to top, var(--tw-gradient-stops))",
|
|
8238
|
-
"gradient-to-tr": "linear-gradient(to top right, var(--tw-gradient-stops))",
|
|
8239
|
-
"gradient-to-r": "linear-gradient(to right, var(--tw-gradient-stops))",
|
|
8240
|
-
"gradient-to-br": "linear-gradient(to bottom right, var(--tw-gradient-stops))",
|
|
8241
|
-
"gradient-to-b": "linear-gradient(to bottom, var(--tw-gradient-stops))",
|
|
8242
|
-
"gradient-to-bl": "linear-gradient(to bottom left, var(--tw-gradient-stops))",
|
|
8243
|
-
"gradient-to-l": "linear-gradient(to left, var(--tw-gradient-stops))",
|
|
8244
|
-
"gradient-to-tl": "linear-gradient(to top left, var(--tw-gradient-stops))"
|
|
8245
|
-
};
|
|
8246
|
-
const cssValue = isArbitrary ? value.replace(/_/g, " ") : gradientMap[value] || value;
|
|
8247
|
-
return `background-image: ${cssValue};`;
|
|
8248
|
-
},
|
|
8249
|
-
// ============================================
|
|
8250
|
-
// GRADIENT COLOR STOPS
|
|
8251
|
-
// ============================================
|
|
8252
|
-
"from": () => {
|
|
8253
|
-
const color = isArbitrary ? value : `var(--c-${value})`;
|
|
8254
|
-
return `--tw-gradient-from: ${color}; --tw-gradient-to: transparent; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);`;
|
|
8255
|
-
},
|
|
8256
|
-
"via": () => {
|
|
8257
|
-
const color = isArbitrary ? value : `var(--c-${value})`;
|
|
8258
|
-
return `--tw-gradient-via: ${color}; --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-via), var(--tw-gradient-to);`;
|
|
8259
|
-
},
|
|
8260
|
-
"to": () => {
|
|
8261
|
-
const color = isArbitrary ? value : `var(--c-${value})`;
|
|
8262
|
-
return `--tw-gradient-to: ${color};`;
|
|
8263
|
-
},
|
|
8264
|
-
// ============================================
|
|
8265
|
-
// BACKDROP FILTER UTILITIES
|
|
8266
|
-
// ============================================
|
|
8267
|
-
"backdrop-blur": () => {
|
|
8268
|
-
const blurScale = {
|
|
8269
|
-
"none": "0",
|
|
8270
|
-
"sm": "4px",
|
|
8271
|
-
"md": "8px",
|
|
8272
|
-
"lg": "12px",
|
|
8273
|
-
"xl": "16px",
|
|
8274
|
-
"2xl": "24px",
|
|
8275
|
-
"3xl": "40px"
|
|
8276
|
-
};
|
|
8277
|
-
const cssValue = isArbitrary ? value : blurScale[value] || `${value}px`;
|
|
8278
|
-
return `backdrop-filter: blur(${cssValue});`;
|
|
8279
|
-
},
|
|
8280
|
-
"backdrop-brightness": () => {
|
|
8281
|
-
const cssValue = isArbitrary ? value : parseFloat(value) / 100;
|
|
8282
|
-
return `backdrop-filter: brightness(${cssValue});`;
|
|
8283
|
-
},
|
|
8284
|
-
"backdrop-contrast": () => {
|
|
8285
|
-
const cssValue = isArbitrary ? value : parseFloat(value) / 100;
|
|
8286
|
-
return `backdrop-filter: contrast(${cssValue});`;
|
|
8287
|
-
},
|
|
8288
|
-
"backdrop-grayscale": () => {
|
|
8289
|
-
const grayscaleScale = { "0": "0", "100": "1", "full": "1" };
|
|
8290
|
-
const cssValue = isArbitrary ? value : grayscaleScale[value] || parseFloat(value) / 100;
|
|
8291
|
-
return `backdrop-filter: grayscale(${cssValue});`;
|
|
8292
|
-
},
|
|
8293
|
-
"backdrop-hue-rotate": () => {
|
|
8294
|
-
const cssValue = isArbitrary ? value : `${value}deg`;
|
|
8295
|
-
return `backdrop-filter: hue-rotate(${cssValue});`;
|
|
8296
|
-
},
|
|
8297
|
-
"backdrop-invert": () => {
|
|
8298
|
-
const invertScale = { "0": "0", "100": "1", "full": "1" };
|
|
8299
|
-
const cssValue = isArbitrary ? value : invertScale[value] || parseFloat(value) / 100;
|
|
8300
|
-
return `backdrop-filter: invert(${cssValue});`;
|
|
8301
|
-
},
|
|
8302
|
-
"backdrop-opacity": () => {
|
|
8303
|
-
const cssValue = isArbitrary ? value : parseFloat(value) / 100;
|
|
8304
|
-
return `backdrop-filter: opacity(${cssValue});`;
|
|
8305
|
-
},
|
|
8306
|
-
"backdrop-saturate": () => {
|
|
8307
|
-
const cssValue = isArbitrary ? value : parseFloat(value) / 100;
|
|
8308
|
-
return `backdrop-filter: saturate(${cssValue});`;
|
|
8309
|
-
},
|
|
8310
|
-
"backdrop-sepia": () => {
|
|
8311
|
-
const sepiaScale = { "0": "0", "100": "1", "full": "1" };
|
|
8312
|
-
const cssValue = isArbitrary ? value : sepiaScale[value] || parseFloat(value) / 100;
|
|
8313
|
-
return `backdrop-filter: sepia(${cssValue});`;
|
|
8314
|
-
},
|
|
8315
|
-
// ============================================
|
|
8316
|
-
// ANIMATION EXTENDED PROPERTIES
|
|
8317
|
-
// ============================================
|
|
8318
|
-
"animation-duration": () => {
|
|
8319
|
-
const durationMap = {
|
|
8320
|
-
"instant": "75ms",
|
|
8321
|
-
"quick": "100ms",
|
|
8322
|
-
"fast": "150ms",
|
|
8323
|
-
"normal": "200ms",
|
|
8324
|
-
"slow": "300ms",
|
|
8325
|
-
"slower": "500ms",
|
|
8326
|
-
"lazy": "700ms"
|
|
8327
|
-
};
|
|
8328
|
-
const cssValue = isArbitrary ? value : durationMap[value] || `${value}ms`;
|
|
8329
|
-
return `animation-duration: ${cssValue};`;
|
|
8330
|
-
},
|
|
8331
|
-
"animation-delay": () => {
|
|
8332
|
-
const delayMap = {
|
|
8333
|
-
"instant": "75ms",
|
|
8334
|
-
"quick": "100ms",
|
|
8335
|
-
"fast": "150ms",
|
|
8336
|
-
"normal": "200ms",
|
|
8337
|
-
"slow": "300ms"
|
|
8338
|
-
};
|
|
8339
|
-
const cssValue = isArbitrary ? value : delayMap[value] || `${value}ms`;
|
|
8340
|
-
return `animation-delay: ${cssValue};`;
|
|
8341
|
-
},
|
|
8342
|
-
"animation-iteration": () => {
|
|
8343
|
-
const iterationMap = { "infinite": "infinite", "once": "1", "twice": "2" };
|
|
8344
|
-
const cssValue = iterationMap[value] || value;
|
|
8345
|
-
return `animation-iteration-count: ${cssValue};`;
|
|
8346
|
-
},
|
|
8347
|
-
"animation-direction": () => {
|
|
8348
|
-
return `animation-direction: ${value};`;
|
|
8349
|
-
},
|
|
8350
|
-
"animation-fill": () => {
|
|
8351
|
-
return `animation-fill-mode: ${value};`;
|
|
8352
|
-
},
|
|
8353
|
-
"animation-play": () => {
|
|
8354
|
-
return `animation-play-state: ${value};`;
|
|
8355
|
-
},
|
|
8356
|
-
"animation-timing": () => {
|
|
8357
|
-
const easeMap = {
|
|
8358
|
-
"linear": "linear",
|
|
8359
|
-
"in": "cubic-bezier(0.4, 0, 1, 1)",
|
|
8360
|
-
"out": "cubic-bezier(0, 0, 0.2, 1)",
|
|
8361
|
-
"in-out": "cubic-bezier(0.4, 0, 0.2, 1)"
|
|
8362
|
-
};
|
|
8363
|
-
const cssValue = easeMap[value] || value;
|
|
8364
|
-
return `animation-timing-function: ${cssValue};`;
|
|
8365
|
-
},
|
|
8366
|
-
// ============================================
|
|
8367
|
-
// SCROLL & INTERACTIVITY UTILITIES
|
|
8368
|
-
// ============================================
|
|
8369
|
-
"scroll-behavior": () => {
|
|
8370
|
-
return `scroll-behavior: ${value};`;
|
|
8371
|
-
},
|
|
8372
|
-
"scroll-m": () => {
|
|
8373
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8374
|
-
return `scroll-margin: ${cssValue};`;
|
|
8375
|
-
},
|
|
8376
|
-
"scroll-m-x": () => {
|
|
8377
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8378
|
-
return `scroll-margin-left: ${cssValue}; scroll-margin-right: ${cssValue};`;
|
|
8379
|
-
},
|
|
8380
|
-
"scroll-m-y": () => {
|
|
8381
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8382
|
-
return `scroll-margin-top: ${cssValue}; scroll-margin-bottom: ${cssValue};`;
|
|
8383
|
-
},
|
|
8384
|
-
"scroll-p": () => {
|
|
8385
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8386
|
-
return `scroll-padding: ${cssValue};`;
|
|
8387
|
-
},
|
|
8388
|
-
"scroll-p-x": () => {
|
|
8389
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8390
|
-
return `scroll-padding-left: ${cssValue}; scroll-padding-right: ${cssValue};`;
|
|
8391
|
-
},
|
|
8392
|
-
"scroll-p-y": () => {
|
|
8393
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8394
|
-
return `scroll-padding-top: ${cssValue}; scroll-padding-bottom: ${cssValue};`;
|
|
8395
|
-
},
|
|
8396
|
-
"snap-align": () => {
|
|
8397
|
-
return `scroll-snap-align: ${value};`;
|
|
8398
|
-
},
|
|
8399
|
-
"snap-stop": () => {
|
|
8400
|
-
return `scroll-snap-stop: ${value};`;
|
|
8401
|
-
},
|
|
8402
|
-
"snap-type": () => {
|
|
8403
|
-
const typeMap = {
|
|
8404
|
-
"none": "none",
|
|
8405
|
-
"x": "x mandatory",
|
|
8406
|
-
"y": "y mandatory",
|
|
8407
|
-
"both": "both mandatory",
|
|
8408
|
-
"x-proximity": "x proximity",
|
|
8409
|
-
"y-proximity": "y proximity"
|
|
8410
|
-
};
|
|
8411
|
-
return `scroll-snap-type: ${typeMap[value] || value};`;
|
|
8412
|
-
},
|
|
8413
|
-
"touch": () => {
|
|
8414
|
-
const touchMap = {
|
|
8415
|
-
"auto": "auto",
|
|
8416
|
-
"none": "none",
|
|
8417
|
-
"pan-x": "pan-x",
|
|
8418
|
-
"pan-y": "pan-y",
|
|
8419
|
-
"pan-left": "pan-left",
|
|
8420
|
-
"pan-right": "pan-right",
|
|
8421
|
-
"pan-up": "pan-up",
|
|
8422
|
-
"pan-down": "pan-down",
|
|
8423
|
-
"pinch-zoom": "pinch-zoom",
|
|
8424
|
-
"manipulation": "manipulation"
|
|
8425
|
-
};
|
|
8426
|
-
return `touch-action: ${touchMap[value] || value};`;
|
|
8427
|
-
},
|
|
8428
|
-
"resize": () => {
|
|
8429
|
-
const resizeMap = {
|
|
8430
|
-
"none": "none",
|
|
8431
|
-
"both": "both",
|
|
8432
|
-
"x": "horizontal",
|
|
8433
|
-
"y": "vertical"
|
|
8434
|
-
};
|
|
8435
|
-
return `resize: ${resizeMap[value] || value};`;
|
|
8436
|
-
},
|
|
8437
|
-
"will-change": () => {
|
|
8438
|
-
const willChangeMap = {
|
|
8439
|
-
"auto": "auto",
|
|
8440
|
-
"scroll": "scroll-position",
|
|
8441
|
-
"contents": "contents",
|
|
8442
|
-
"transform": "transform",
|
|
8443
|
-
"opacity": "opacity"
|
|
8444
|
-
};
|
|
8445
|
-
return `will-change: ${willChangeMap[value] || value};`;
|
|
8446
|
-
},
|
|
8447
|
-
"color-scheme": () => {
|
|
8448
|
-
return `color-scheme: ${value};`;
|
|
8449
|
-
},
|
|
8450
|
-
"field-sizing": () => {
|
|
8451
|
-
return `field-sizing: ${value};`;
|
|
8452
|
-
},
|
|
8453
|
-
"forced-color": () => {
|
|
8454
|
-
return `forced-color-adjust: ${value};`;
|
|
8455
|
-
},
|
|
8456
|
-
// ============================================
|
|
8457
|
-
// BORDER & OUTLINE UTILITIES
|
|
8458
|
-
// ============================================
|
|
8459
|
-
"border-style": () => {
|
|
8460
|
-
return `border-style: ${value};`;
|
|
8461
|
-
},
|
|
8462
|
-
"outline": () => {
|
|
8463
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
8464
|
-
return `outline-color: ${cssValue};`;
|
|
8465
|
-
},
|
|
8466
|
-
"outline-style": () => {
|
|
8467
|
-
return `outline-style: ${value};`;
|
|
8468
|
-
},
|
|
8469
|
-
"outline-w": () => {
|
|
8470
|
-
const cssValue = isArbitrary ? value : `${value}px`;
|
|
8471
|
-
return `outline-width: ${cssValue};`;
|
|
8472
|
-
},
|
|
8473
|
-
"outline-offset": () => {
|
|
8474
|
-
const cssValue = isArbitrary ? value : `${value}px`;
|
|
8475
|
-
return `outline-offset: ${cssValue};`;
|
|
8476
|
-
},
|
|
8477
|
-
// ============================================
|
|
8478
|
-
// RING UTILITIES (Focus Ring)
|
|
8479
|
-
// ============================================
|
|
8480
|
-
"ring": () => {
|
|
8481
|
-
if (value === "none") {
|
|
8482
|
-
return `box-shadow: 0 0 0 0 transparent;`;
|
|
8483
|
-
}
|
|
8484
|
-
const cssValue = isArbitrary ? value : `var(--ring-${value})`;
|
|
8485
|
-
return `box-shadow: 0 0 0 var(--ring-offset) var(--ring-offset-color), 0 0 0 calc(${cssValue} + var(--ring-offset)) var(--ring-color);`;
|
|
8486
|
-
},
|
|
8487
|
-
"ring-color": () => {
|
|
8488
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
8489
|
-
return `--ring-color: ${cssValue};`;
|
|
8490
|
-
},
|
|
8491
|
-
"ring-offset": () => {
|
|
8492
|
-
const cssValue = isArbitrary ? value : `${value}px`;
|
|
8493
|
-
return `--ring-offset: ${cssValue};`;
|
|
8494
|
-
},
|
|
8495
|
-
"ring-offset-color": () => {
|
|
8496
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
8497
|
-
return `--ring-offset-color ${cssValue};`;
|
|
8498
|
-
},
|
|
8499
|
-
// ============================================
|
|
8500
|
-
// DIVIDE UTILITIES
|
|
8501
|
-
// ============================================
|
|
8502
|
-
"divide": () => {
|
|
8503
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
8504
|
-
return `border-color: ${cssValue}; border-style: solid;`;
|
|
8505
|
-
},
|
|
8506
|
-
"divide-x": () => {
|
|
8507
|
-
if (value === "reverse") {
|
|
8508
|
-
return "--ss-divide-x-reverse: 1;";
|
|
8509
|
-
}
|
|
8510
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
8511
|
-
return `border-left-color: ${cssValue}; border-right-color: ${cssValue}; border-left-style: solid; border-right-style: solid;`;
|
|
8512
|
-
},
|
|
8513
|
-
"divide-y": () => {
|
|
8514
|
-
if (value === "reverse") {
|
|
8515
|
-
return "--ss-divide-y-reverse: 1;";
|
|
8704
|
+
for (const token of baseTokens) {
|
|
8705
|
+
css += generateRule(token, config, false, interactIds);
|
|
8706
|
+
}
|
|
8707
|
+
for (const [bp, bpTokens] of Object.entries(breakpointTokens)) {
|
|
8708
|
+
if (bpTokens.length > 0) {
|
|
8709
|
+
css += `
|
|
8710
|
+
@media (min-width: ${screens[bp]}) {
|
|
8711
|
+
`;
|
|
8712
|
+
const processedResetSelectors = /* @__PURE__ */ new Set();
|
|
8713
|
+
for (const bpToken of bpTokens) {
|
|
8714
|
+
if (bpToken.attrType && displayProps.includes(bpToken.property)) {
|
|
8715
|
+
if (baseDisplayTokens.has(bpToken.attrType)) {
|
|
8716
|
+
const baseDisplays = baseDisplayTokens.get(bpToken.attrType);
|
|
8717
|
+
if (baseDisplays.size > 0 && !baseDisplays.has(bpToken.raw) && !processedResetSelectors.has(bpToken.raw)) {
|
|
8718
|
+
const selector = `[${bpToken.attrType}~="${bpToken.raw}"]`;
|
|
8719
|
+
css += ` ${selector} { display: revert-layer; }
|
|
8720
|
+
`;
|
|
8721
|
+
processedResetSelectors.add(bpToken.raw);
|
|
8722
|
+
}
|
|
8723
|
+
}
|
|
8516
8724
|
}
|
|
8517
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
8518
|
-
return `border-top-color: ${cssValue}; border-bottom-color: ${cssValue}; border-top-style: solid; border-bottom-style: solid;`;
|
|
8519
|
-
},
|
|
8520
|
-
"divide-w": () => {
|
|
8521
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8522
|
-
return `border-width: ${cssValue}; border-style: solid;`;
|
|
8523
|
-
},
|
|
8524
|
-
"divide-x-w": () => {
|
|
8525
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8526
|
-
return `
|
|
8527
|
-
border-right-width: calc(${cssValue} * var(--ss-divide-x-reverse, 0));
|
|
8528
|
-
border-left-width: calc(${cssValue} * (1 - var(--ss-divide-x-reverse, 0)));
|
|
8529
|
-
border-left-style: solid;
|
|
8530
|
-
border-right-style: solid;
|
|
8531
|
-
`;
|
|
8532
|
-
},
|
|
8533
|
-
"divide-y-w": () => {
|
|
8534
|
-
const cssValue = isArbitrary ? value : `var(--s-${value})`;
|
|
8535
|
-
return `
|
|
8536
|
-
border-bottom-width: calc(${cssValue} * var(--ss-divide-y-reverse, 0));
|
|
8537
|
-
border-top-width: calc(${cssValue} * (1 - var(--ss-divide-y-reverse, 0)));
|
|
8538
|
-
border-top-style: solid;
|
|
8539
|
-
border-bottom-style: solid;
|
|
8540
|
-
`;
|
|
8541
|
-
},
|
|
8542
|
-
"divide-x:reverse": () => {
|
|
8543
|
-
return "--ss-divide-x-reverse: 1;";
|
|
8544
|
-
},
|
|
8545
|
-
"divide-y:reverse": () => {
|
|
8546
|
-
return "--ss-divide-y-reverse: 1;";
|
|
8547
|
-
},
|
|
8548
|
-
"divide-style": () => {
|
|
8549
|
-
return `border-style: ${value};`;
|
|
8550
|
-
},
|
|
8551
|
-
// ============================================
|
|
8552
|
-
// SVG UTILITIES
|
|
8553
|
-
// ============================================
|
|
8554
|
-
"stroke": () => {
|
|
8555
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
8556
|
-
return `stroke: ${cssValue};`;
|
|
8557
|
-
},
|
|
8558
|
-
"stroke-w": () => {
|
|
8559
|
-
const cssValue = isArbitrary ? value : value;
|
|
8560
|
-
return `stroke-width: ${cssValue};`;
|
|
8561
|
-
},
|
|
8562
|
-
"fill": () => {
|
|
8563
|
-
if (value === "none") return "fill: none;";
|
|
8564
|
-
const cssValue = isArbitrary ? value : `var(--c-${value})`;
|
|
8565
|
-
return `fill: ${cssValue};`;
|
|
8566
|
-
},
|
|
8567
|
-
// ============================================
|
|
8568
|
-
// MIX BLEND MODE
|
|
8569
|
-
// ============================================
|
|
8570
|
-
"mix-blend": () => {
|
|
8571
|
-
return `mix-blend-mode: ${value};`;
|
|
8572
|
-
},
|
|
8573
|
-
// ============================================
|
|
8574
|
-
// 3D TRANSFORM UTILITIES
|
|
8575
|
-
// ============================================
|
|
8576
|
-
"perspective": () => {
|
|
8577
|
-
const perspectiveMap = {
|
|
8578
|
-
"none": "none",
|
|
8579
|
-
"sm": "500px",
|
|
8580
|
-
"md": "1000px",
|
|
8581
|
-
"lg": "1500px",
|
|
8582
|
-
"xl": "2000px"
|
|
8583
|
-
};
|
|
8584
|
-
const cssValue = isArbitrary ? value : perspectiveMap[value] || value;
|
|
8585
|
-
return `perspective: ${cssValue};`;
|
|
8586
|
-
},
|
|
8587
|
-
"perspective-origin": () => {
|
|
8588
|
-
const originMap = {
|
|
8589
|
-
"center": "center",
|
|
8590
|
-
"top": "top",
|
|
8591
|
-
"top-right": "top right",
|
|
8592
|
-
"right": "right",
|
|
8593
|
-
"bottom-right": "bottom right",
|
|
8594
|
-
"bottom": "bottom",
|
|
8595
|
-
"bottom-left": "bottom left",
|
|
8596
|
-
"left": "left",
|
|
8597
|
-
"top-left": "top left"
|
|
8598
|
-
};
|
|
8599
|
-
const cssValue = isArbitrary ? value.replace(/_/g, " ") : originMap[value] || value;
|
|
8600
|
-
return `perspective-origin: ${cssValue};`;
|
|
8601
|
-
},
|
|
8602
|
-
"rotate-x": () => {
|
|
8603
|
-
const rotateValue = isArbitrary ? value : `${value}deg`;
|
|
8604
|
-
return `transform: rotateX(${rotateValue});`;
|
|
8605
|
-
},
|
|
8606
|
-
"rotate-y": () => {
|
|
8607
|
-
const rotateValue = isArbitrary ? value : `${value}deg`;
|
|
8608
|
-
return `transform: rotateY(${rotateValue});`;
|
|
8609
|
-
},
|
|
8610
|
-
"rotate-z": () => {
|
|
8611
|
-
const rotateValue = isArbitrary ? value : `${value}deg`;
|
|
8612
|
-
return `transform: rotateZ(${rotateValue});`;
|
|
8613
|
-
},
|
|
8614
|
-
"transform-style": () => {
|
|
8615
|
-
return `transform-style: ${value};`;
|
|
8616
|
-
},
|
|
8617
|
-
"backface": () => {
|
|
8618
|
-
const backfaceMap = { "visible": "visible", "hidden": "hidden" };
|
|
8619
|
-
return `backface-visibility: ${backfaceMap[value] || value};`;
|
|
8620
8725
|
}
|
|
8621
|
-
|
|
8622
|
-
|
|
8623
|
-
|
|
8726
|
+
for (const token of bpTokens) {
|
|
8727
|
+
css += " " + generateRule(token, config, false, interactIds);
|
|
8728
|
+
}
|
|
8729
|
+
css += "}\n";
|
|
8730
|
+
}
|
|
8624
8731
|
}
|
|
8625
|
-
|
|
8626
|
-
|
|
8627
|
-
|
|
8732
|
+
if (darkTokens.length > 0) {
|
|
8733
|
+
const darkMode = config.darkMode || "media";
|
|
8734
|
+
const darkSelector = getDarkModeSelector(config);
|
|
8735
|
+
if (darkMode === "media") {
|
|
8736
|
+
css += `
|
|
8737
|
+
/* Dark Mode (prefers-color-scheme) */
|
|
8738
|
+
`;
|
|
8739
|
+
css += `@media (prefers-color-scheme: dark) {
|
|
8628
8740
|
`;
|
|
8741
|
+
for (const token of darkTokens) {
|
|
8742
|
+
css += " " + generateRule(token, config, true, interactIds);
|
|
8743
|
+
}
|
|
8744
|
+
css += "}\n";
|
|
8745
|
+
} else {
|
|
8746
|
+
css += `
|
|
8747
|
+
/* Dark Mode (${darkSelector}) */
|
|
8748
|
+
`;
|
|
8749
|
+
for (const token of darkTokens) {
|
|
8750
|
+
const baseRule = generateRule(token, config, true, interactIds);
|
|
8751
|
+
const wrappedRule = baseRule.replace(/^(\[[^\]]+\])/, `${darkSelector} $1`);
|
|
8752
|
+
css += wrappedRule;
|
|
8753
|
+
}
|
|
8629
8754
|
}
|
|
8630
|
-
|
|
8631
|
-
|
|
8632
|
-
|
|
8633
|
-
|
|
8634
|
-
|
|
8635
|
-
|
|
8636
|
-
|
|
8637
|
-
|
|
8638
|
-
|
|
8639
|
-
|
|
8640
|
-
|
|
8641
|
-
|
|
8642
|
-
|
|
8643
|
-
|
|
8644
|
-
|
|
8645
|
-
|
|
8646
|
-
|
|
8647
|
-
|
|
8755
|
+
}
|
|
8756
|
+
return css;
|
|
8757
|
+
}
|
|
8758
|
+
|
|
8759
|
+
// src/config/defaults.js
|
|
8760
|
+
var defaultConfig = {
|
|
8761
|
+
// Input files to scan for attributes
|
|
8762
|
+
content: [
|
|
8763
|
+
"./**/*.html",
|
|
8764
|
+
"./src/**/*.{html,jsx,tsx,vue,svelte}",
|
|
8765
|
+
"./pages/**/*.{html,jsx,tsx}",
|
|
8766
|
+
"./components/**/*.{html,jsx,tsx}"
|
|
8767
|
+
],
|
|
8768
|
+
// Output configuration
|
|
8769
|
+
output: {
|
|
8770
|
+
css: "./public/senangstart.css",
|
|
8771
|
+
minify: false,
|
|
8772
|
+
aiContext: "./.cursorrules",
|
|
8773
|
+
typescript: "./types/senang.d.ts"
|
|
8774
|
+
},
|
|
8775
|
+
// Dark mode configuration
|
|
8776
|
+
// 'media' - Uses @media (prefers-color-scheme: dark)
|
|
8777
|
+
// 'selector' - Uses .dark class on html/body
|
|
8778
|
+
// ['selector', '.custom-dark'] - Uses custom selector
|
|
8779
|
+
darkMode: "media",
|
|
8780
|
+
// Preflight: Include opinionated base reset styles
|
|
8781
|
+
// true - Include all preflight styles (default)
|
|
8782
|
+
// false - Disable preflight completely
|
|
8783
|
+
preflight: true,
|
|
8784
|
+
theme: {
|
|
8785
|
+
// 1. SPACING: The "Natural Object" Scale with multiplier variants
|
|
8786
|
+
// Logic: How big is the object/gap physically?
|
|
8787
|
+
spacing: {
|
|
8788
|
+
"none": "0px",
|
|
8789
|
+
// No space
|
|
8790
|
+
"thin": "1px",
|
|
8791
|
+
// Hairline (for borders)
|
|
8792
|
+
"regular": "2px",
|
|
8793
|
+
// Standard border
|
|
8794
|
+
"thick": "3px",
|
|
8795
|
+
// Bold border
|
|
8796
|
+
"tiny": "4px",
|
|
8797
|
+
// Small offsets
|
|
8798
|
+
"tiny-2x": "6px",
|
|
8799
|
+
// Tiny multiplied
|
|
8800
|
+
"small": "8px",
|
|
8801
|
+
// Grouping inside components
|
|
8802
|
+
"small-2x": "10px",
|
|
8803
|
+
//
|
|
8804
|
+
"small-3x": "12px",
|
|
8805
|
+
//
|
|
8806
|
+
"small-4x": "14px",
|
|
8807
|
+
//
|
|
8808
|
+
"medium": "16px",
|
|
8809
|
+
// Standard default
|
|
8810
|
+
"medium-2x": "20px",
|
|
8811
|
+
//
|
|
8812
|
+
"medium-3x": "24px",
|
|
8813
|
+
//
|
|
8814
|
+
"medium-4x": "28px",
|
|
8815
|
+
//
|
|
8816
|
+
"large": "32px",
|
|
8817
|
+
// Separation between groups
|
|
8818
|
+
"large-2x": "36px",
|
|
8819
|
+
//
|
|
8820
|
+
"large-3x": "40px",
|
|
8821
|
+
//
|
|
8822
|
+
"large-4x": "44px",
|
|
8823
|
+
//
|
|
8824
|
+
"big": "48px",
|
|
8825
|
+
// Layout sections
|
|
8826
|
+
"big-2x": "56px",
|
|
8827
|
+
//
|
|
8828
|
+
"big-3x": "64px",
|
|
8829
|
+
//
|
|
8830
|
+
"big-4x": "80px",
|
|
8831
|
+
//
|
|
8832
|
+
"giant": "96px",
|
|
8833
|
+
// Hero sections
|
|
8834
|
+
"giant-2x": "112px",
|
|
8835
|
+
//
|
|
8836
|
+
"giant-3x": "128px",
|
|
8837
|
+
//
|
|
8838
|
+
"giant-4x": "144px",
|
|
8839
|
+
//
|
|
8840
|
+
"vast": "160px",
|
|
8841
|
+
// Page-level spacing
|
|
8842
|
+
"vast-2x": "176px",
|
|
8843
|
+
//
|
|
8844
|
+
"vast-3x": "192px",
|
|
8845
|
+
//
|
|
8846
|
+
"vast-4x": "208px",
|
|
8847
|
+
//
|
|
8848
|
+
"vast-5x": "224px",
|
|
8849
|
+
//
|
|
8850
|
+
"vast-6x": "240px",
|
|
8851
|
+
//
|
|
8852
|
+
"vast-7x": "256px",
|
|
8853
|
+
//
|
|
8854
|
+
"vast-8x": "288px",
|
|
8855
|
+
//
|
|
8856
|
+
"vast-9x": "320px",
|
|
8857
|
+
//
|
|
8858
|
+
"vast-10x": "384px"
|
|
8859
|
+
//
|
|
8860
|
+
},
|
|
8861
|
+
// 2. RADIUS: Tactile Feel
|
|
8862
|
+
radius: {
|
|
8863
|
+
"none": "0px",
|
|
8864
|
+
// Sharp corners
|
|
8865
|
+
"small": "4px",
|
|
8866
|
+
// Subtle nudge
|
|
8867
|
+
"medium": "8px",
|
|
8868
|
+
// Soft corner
|
|
8869
|
+
"big": "16px",
|
|
8870
|
+
// Distinct curve
|
|
8871
|
+
"round": "9999px"
|
|
8872
|
+
// Pill/Circle
|
|
8873
|
+
},
|
|
8874
|
+
// 3. SHADOWS: Depth Perception
|
|
8875
|
+
shadow: {
|
|
8876
|
+
"none": "none",
|
|
8877
|
+
"small": "0 1px 2px rgba(0,0,0,0.05)",
|
|
8878
|
+
"medium": "0 4px 6px rgba(0,0,0,0.1)",
|
|
8879
|
+
"big": "0 10px 15px rgba(0,0,0,0.15)",
|
|
8880
|
+
"giant": "0 25px 50px rgba(0,0,0,0.25)"
|
|
8881
|
+
},
|
|
8882
|
+
// 4. FONT SIZES: Reading Scale (with paired line-heights)
|
|
8883
|
+
fontSize: {
|
|
8884
|
+
"mini": "0.75rem",
|
|
8885
|
+
// 12px
|
|
8886
|
+
"small": "0.875rem",
|
|
8887
|
+
// 14px
|
|
8888
|
+
"base": "1rem",
|
|
8889
|
+
// 16px
|
|
8890
|
+
"large": "1.125rem",
|
|
8891
|
+
// 18px
|
|
8892
|
+
"big": "1.25rem",
|
|
8893
|
+
// 20px (xl)
|
|
8894
|
+
"huge": "1.5rem",
|
|
8895
|
+
// 24px (2xl)
|
|
8896
|
+
"grand": "1.875rem",
|
|
8897
|
+
// 30px (3xl)
|
|
8898
|
+
"giant": "2.25rem",
|
|
8899
|
+
// 36px (4xl)
|
|
8900
|
+
"mount": "3rem",
|
|
8901
|
+
// 48px (5xl)
|
|
8902
|
+
"mega": "3.75rem",
|
|
8903
|
+
// 60px (6xl)
|
|
8904
|
+
"giga": "4.5rem",
|
|
8905
|
+
// 72px (7xl)
|
|
8906
|
+
"tera": "6rem",
|
|
8907
|
+
// 96px (8xl)
|
|
8908
|
+
"hero": "8rem"
|
|
8909
|
+
// 128px
|
|
8910
|
+
},
|
|
8911
|
+
// 4b. FONT SIZE LINE-HEIGHTS: Paired with font sizes
|
|
8912
|
+
fontSizeLineHeight: {
|
|
8913
|
+
"mini": "1rem",
|
|
8914
|
+
// 16px
|
|
8915
|
+
"small": "1.25rem",
|
|
8916
|
+
// 20px
|
|
8917
|
+
"base": "1.5rem",
|
|
8918
|
+
// 24px
|
|
8919
|
+
"large": "1.75rem",
|
|
8920
|
+
// 28px
|
|
8921
|
+
"big": "1.75rem",
|
|
8922
|
+
// 28px
|
|
8923
|
+
"huge": "2rem",
|
|
8924
|
+
// 32px
|
|
8925
|
+
"grand": "2.25rem",
|
|
8926
|
+
// 36px
|
|
8927
|
+
"giant": "2.5rem",
|
|
8928
|
+
// 40px
|
|
8929
|
+
"mount": "1",
|
|
8930
|
+
// 48px (unitless 1)
|
|
8931
|
+
"mega": "1",
|
|
8932
|
+
// 60px (unitless 1)
|
|
8933
|
+
"giga": "1",
|
|
8934
|
+
// 72px (unitless 1)
|
|
8935
|
+
"tera": "1",
|
|
8936
|
+
// 96px (unitless 1)
|
|
8937
|
+
"hero": "1"
|
|
8938
|
+
// 128px (unitless 1)
|
|
8939
|
+
},
|
|
8940
|
+
// 5. FONT WEIGHTS
|
|
8941
|
+
fontWeight: {
|
|
8942
|
+
"normal": "400",
|
|
8943
|
+
"medium": "500",
|
|
8944
|
+
"bold": "700"
|
|
8945
|
+
},
|
|
8946
|
+
// 6. BREAKPOINTS: Device Intent
|
|
8947
|
+
screens: {
|
|
8948
|
+
"mob": "480px",
|
|
8949
|
+
// Mobile
|
|
8950
|
+
"tab": "768px",
|
|
8951
|
+
// Tablet
|
|
8952
|
+
"lap": "1024px",
|
|
8953
|
+
// Laptop
|
|
8954
|
+
"desk": "1280px",
|
|
8955
|
+
// Desktop
|
|
8956
|
+
// Tailwind Compatibility
|
|
8957
|
+
"tw-sm": "640px",
|
|
8958
|
+
"tw-md": "768px",
|
|
8959
|
+
"tw-lg": "1024px",
|
|
8960
|
+
"tw-xl": "1280px",
|
|
8961
|
+
"tw-2xl": "1536px"
|
|
8962
|
+
},
|
|
8963
|
+
// 7. COLORS: Palette Scales
|
|
8964
|
+
colors: {
|
|
8965
|
+
// Base colors
|
|
8966
|
+
"white": "#FFFFFF",
|
|
8967
|
+
"black": "#000000",
|
|
8968
|
+
// Brand/Semantic colors
|
|
8969
|
+
"grey": "#6B7280",
|
|
8970
|
+
"dark": "#3E4A5D",
|
|
8971
|
+
// Brand dark
|
|
8972
|
+
"light": "#DBEAFE",
|
|
8973
|
+
// Brand light/secondary
|
|
8974
|
+
"primary": "#2563EB",
|
|
8975
|
+
// Brand primary
|
|
8976
|
+
"secondary": "#1E40AF",
|
|
8977
|
+
// Brand secondary
|
|
8978
|
+
"success": "#10B981",
|
|
8979
|
+
"warning": "#F59E0B",
|
|
8980
|
+
"danger": "#EF4444",
|
|
8981
|
+
// Red
|
|
8982
|
+
"red-50": "#FEF2F2",
|
|
8983
|
+
"red-100": "#FEE2E2",
|
|
8984
|
+
"red-200": "#FECACA",
|
|
8985
|
+
"red-300": "#FCA5A5",
|
|
8986
|
+
"red-400": "#F87171",
|
|
8987
|
+
"red-500": "#EF4444",
|
|
8988
|
+
"red-600": "#DC2626",
|
|
8989
|
+
"red-700": "#B91C1C",
|
|
8990
|
+
"red-800": "#991B1B",
|
|
8991
|
+
"red-900": "#7F1D1D",
|
|
8992
|
+
"red-950": "#450A0A",
|
|
8993
|
+
// Orange
|
|
8994
|
+
"orange-50": "#FFF7ED",
|
|
8995
|
+
"orange-100": "#FFEDD5",
|
|
8996
|
+
"orange-200": "#FED7AA",
|
|
8997
|
+
"orange-300": "#FDBA74",
|
|
8998
|
+
"orange-400": "#FB923C",
|
|
8999
|
+
"orange-500": "#F97316",
|
|
9000
|
+
"orange-600": "#EA580C",
|
|
9001
|
+
"orange-700": "#C2410C",
|
|
9002
|
+
"orange-800": "#9A3412",
|
|
9003
|
+
"orange-900": "#7C2D12",
|
|
9004
|
+
"orange-950": "#431407",
|
|
9005
|
+
// Amber
|
|
9006
|
+
"amber-50": "#FFFBEB",
|
|
9007
|
+
"amber-100": "#FEF3C7",
|
|
9008
|
+
"amber-200": "#FDE68A",
|
|
9009
|
+
"amber-300": "#FCD34D",
|
|
9010
|
+
"amber-400": "#FBBF24",
|
|
9011
|
+
"amber-500": "#F59E0B",
|
|
9012
|
+
"amber-600": "#D97706",
|
|
9013
|
+
"amber-700": "#B45309",
|
|
9014
|
+
"amber-800": "#92400E",
|
|
9015
|
+
"amber-900": "#78350F",
|
|
9016
|
+
"amber-950": "#451A03",
|
|
9017
|
+
// Yellow
|
|
9018
|
+
"yellow-50": "#FEFCE8",
|
|
9019
|
+
"yellow-100": "#FEF9C3",
|
|
9020
|
+
"yellow-200": "#FEF08A",
|
|
9021
|
+
"yellow-300": "#FDE047",
|
|
9022
|
+
"yellow-400": "#FACC15",
|
|
9023
|
+
"yellow-500": "#EAB308",
|
|
9024
|
+
"yellow-600": "#CA8A04",
|
|
9025
|
+
"yellow-700": "#A16207",
|
|
9026
|
+
"yellow-800": "#854D0E",
|
|
9027
|
+
"yellow-900": "#713F12",
|
|
9028
|
+
"yellow-950": "#422006",
|
|
9029
|
+
// Lime
|
|
9030
|
+
"lime-50": "#F7FEE7",
|
|
9031
|
+
"lime-100": "#ECFCCB",
|
|
9032
|
+
"lime-200": "#D9F99D",
|
|
9033
|
+
"lime-300": "#BEF264",
|
|
9034
|
+
"lime-400": "#A3E635",
|
|
9035
|
+
"lime-500": "#84CC16",
|
|
9036
|
+
"lime-600": "#65A30D",
|
|
9037
|
+
"lime-700": "#4D7C0F",
|
|
9038
|
+
"lime-800": "#3F6212",
|
|
9039
|
+
"lime-900": "#365314",
|
|
9040
|
+
"lime-950": "#1A2E05",
|
|
9041
|
+
// Green
|
|
9042
|
+
"green-50": "#F0FDF4",
|
|
9043
|
+
"green-100": "#DCFCE7",
|
|
9044
|
+
"green-200": "#BBF7D0",
|
|
9045
|
+
"green-300": "#86EFAC",
|
|
9046
|
+
"green-400": "#4ADE80",
|
|
9047
|
+
"green-500": "#22C55E",
|
|
9048
|
+
"green-600": "#16A34A",
|
|
9049
|
+
"green-700": "#15803D",
|
|
9050
|
+
"green-800": "#166534",
|
|
9051
|
+
"green-900": "#14532D",
|
|
9052
|
+
"green-950": "#052E16",
|
|
9053
|
+
// Emerald
|
|
9054
|
+
"emerald-50": "#ECFDF5",
|
|
9055
|
+
"emerald-100": "#D1FAE5",
|
|
9056
|
+
"emerald-200": "#A7F3D0",
|
|
9057
|
+
"emerald-300": "#6EE7B7",
|
|
9058
|
+
"emerald-400": "#34D399",
|
|
9059
|
+
"emerald-500": "#10B981",
|
|
9060
|
+
"emerald-600": "#059669",
|
|
9061
|
+
"emerald-700": "#047857",
|
|
9062
|
+
"emerald-800": "#065F46",
|
|
9063
|
+
"emerald-900": "#064E3B",
|
|
9064
|
+
"emerald-950": "#022C22",
|
|
9065
|
+
// Teal
|
|
9066
|
+
"teal-50": "#F0FDFA",
|
|
9067
|
+
"teal-100": "#CCFBF1",
|
|
9068
|
+
"teal-200": "#99F6E4",
|
|
9069
|
+
"teal-300": "#5EEAD4",
|
|
9070
|
+
"teal-400": "#2DD4BF",
|
|
9071
|
+
"teal-500": "#14B8A6",
|
|
9072
|
+
"teal-600": "#0D9488",
|
|
9073
|
+
"teal-700": "#0F766E",
|
|
9074
|
+
"teal-800": "#115E59",
|
|
9075
|
+
"teal-900": "#134E4A",
|
|
9076
|
+
"teal-950": "#042F2E",
|
|
9077
|
+
// Cyan
|
|
9078
|
+
"cyan-50": "#ECFEFF",
|
|
9079
|
+
"cyan-100": "#CFFAFE",
|
|
9080
|
+
"cyan-200": "#A5F3FC",
|
|
9081
|
+
"cyan-300": "#67E8F9",
|
|
9082
|
+
"cyan-400": "#22D3EE",
|
|
9083
|
+
"cyan-500": "#06B6D4",
|
|
9084
|
+
"cyan-600": "#0891B2",
|
|
9085
|
+
"cyan-700": "#0E7490",
|
|
9086
|
+
"cyan-800": "#155E75",
|
|
9087
|
+
"cyan-900": "#164E63",
|
|
9088
|
+
"cyan-950": "#083344",
|
|
9089
|
+
// Sky
|
|
9090
|
+
"sky-50": "#F0F9FF",
|
|
9091
|
+
"sky-100": "#E0F2FE",
|
|
9092
|
+
"sky-200": "#BAE6FD",
|
|
9093
|
+
"sky-300": "#7DD3FC",
|
|
9094
|
+
"sky-400": "#38BDF8",
|
|
9095
|
+
"sky-500": "#0EA5E9",
|
|
9096
|
+
"sky-600": "#0284C7",
|
|
9097
|
+
"sky-700": "#0369A1",
|
|
9098
|
+
"sky-800": "#075985",
|
|
9099
|
+
"sky-900": "#0C4A6E",
|
|
9100
|
+
"sky-950": "#082F49",
|
|
9101
|
+
// Blue
|
|
9102
|
+
"blue-50": "#EFF6FF",
|
|
9103
|
+
"blue-100": "#DBEAFE",
|
|
9104
|
+
"blue-200": "#BFDBFE",
|
|
9105
|
+
"blue-300": "#93C5FD",
|
|
9106
|
+
"blue-400": "#60A5FA",
|
|
9107
|
+
"blue-500": "#3B82F6",
|
|
9108
|
+
"blue-600": "#2563EB",
|
|
9109
|
+
"blue-700": "#1D4ED8",
|
|
9110
|
+
"blue-800": "#1E40AF",
|
|
9111
|
+
"blue-900": "#1E3A8A",
|
|
9112
|
+
"blue-950": "#172554",
|
|
9113
|
+
// Indigo
|
|
9114
|
+
"indigo-50": "#EEF2FF",
|
|
9115
|
+
"indigo-100": "#E0E7FF",
|
|
9116
|
+
"indigo-200": "#C7D2FE",
|
|
9117
|
+
"indigo-300": "#A5B4FC",
|
|
9118
|
+
"indigo-400": "#818CF8",
|
|
9119
|
+
"indigo-500": "#6366F1",
|
|
9120
|
+
"indigo-600": "#4F46E5",
|
|
9121
|
+
"indigo-700": "#4338CA",
|
|
9122
|
+
"indigo-800": "#3730A3",
|
|
9123
|
+
"indigo-900": "#312E81",
|
|
9124
|
+
"indigo-950": "#1E1B4B",
|
|
9125
|
+
// Violet
|
|
9126
|
+
"violet-50": "#F5F3FF",
|
|
9127
|
+
"violet-100": "#EDE9FE",
|
|
9128
|
+
"violet-200": "#DDD6FE",
|
|
9129
|
+
"violet-300": "#C4B5FD",
|
|
9130
|
+
"violet-400": "#A78BFA",
|
|
9131
|
+
"violet-500": "#8B5CF6",
|
|
9132
|
+
"violet-600": "#7C3AED",
|
|
9133
|
+
"violet-700": "#6D28D9",
|
|
9134
|
+
"violet-800": "#5B21B6",
|
|
9135
|
+
"violet-900": "#4C1D95",
|
|
9136
|
+
"violet-950": "#2E1065",
|
|
9137
|
+
// Purple
|
|
9138
|
+
"purple-50": "#FAF5FF",
|
|
9139
|
+
"purple-100": "#F3E8FF",
|
|
9140
|
+
"purple-200": "#E9D5FF",
|
|
9141
|
+
"purple-300": "#D8B4FE",
|
|
9142
|
+
"purple-400": "#C084FC",
|
|
9143
|
+
"purple-500": "#A855F7",
|
|
9144
|
+
"purple-600": "#9333EA",
|
|
9145
|
+
"purple-700": "#7E22CE",
|
|
9146
|
+
"purple-800": "#6B21A8",
|
|
9147
|
+
"purple-900": "#581C87",
|
|
9148
|
+
"purple-950": "#3B0764",
|
|
9149
|
+
// Fuchsia
|
|
9150
|
+
"fuchsia-50": "#FDF4FF",
|
|
9151
|
+
"fuchsia-100": "#FAE8FF",
|
|
9152
|
+
"fuchsia-200": "#F5D0FE",
|
|
9153
|
+
"fuchsia-300": "#F0ABFC",
|
|
9154
|
+
"fuchsia-400": "#E879F9",
|
|
9155
|
+
"fuchsia-500": "#D946EF",
|
|
9156
|
+
"fuchsia-600": "#C026D3",
|
|
9157
|
+
"fuchsia-700": "#A21CAF",
|
|
9158
|
+
"fuchsia-800": "#86198F",
|
|
9159
|
+
"fuchsia-900": "#701A75",
|
|
9160
|
+
"fuchsia-950": "#4A044E",
|
|
9161
|
+
// Pink
|
|
9162
|
+
"pink-50": "#FDF2F8",
|
|
9163
|
+
"pink-100": "#FCE7F3",
|
|
9164
|
+
"pink-200": "#FBCFE8",
|
|
9165
|
+
"pink-300": "#F9A8D4",
|
|
9166
|
+
"pink-400": "#F472B6",
|
|
9167
|
+
"pink-500": "#EC4899",
|
|
9168
|
+
"pink-600": "#DB2777",
|
|
9169
|
+
"pink-700": "#BE185D",
|
|
9170
|
+
"pink-800": "#9D174D",
|
|
9171
|
+
"pink-900": "#831843",
|
|
9172
|
+
"pink-950": "#500724",
|
|
9173
|
+
// Rose
|
|
9174
|
+
"rose-50": "#FFF1F2",
|
|
9175
|
+
"rose-100": "#FFE4E6",
|
|
9176
|
+
"rose-200": "#FECDD3",
|
|
9177
|
+
"rose-300": "#FDA4AF",
|
|
9178
|
+
"rose-400": "#FB7185",
|
|
9179
|
+
"rose-500": "#F43F5E",
|
|
9180
|
+
"rose-600": "#E11D48",
|
|
9181
|
+
"rose-700": "#BE123C",
|
|
9182
|
+
"rose-800": "#9F1239",
|
|
9183
|
+
"rose-900": "#881337",
|
|
9184
|
+
"rose-950": "#4C0519",
|
|
9185
|
+
// Slate
|
|
9186
|
+
"slate-50": "#F8FAFC",
|
|
9187
|
+
"slate-100": "#F1F5F9",
|
|
9188
|
+
"slate-200": "#E2E8F0",
|
|
9189
|
+
"slate-300": "#CBD5E1",
|
|
9190
|
+
"slate-400": "#94A3B8",
|
|
9191
|
+
"slate-500": "#64748B",
|
|
9192
|
+
"slate-600": "#475569",
|
|
9193
|
+
"slate-700": "#334155",
|
|
9194
|
+
"slate-800": "#1E293B",
|
|
9195
|
+
"slate-900": "#0F172A",
|
|
9196
|
+
"slate-950": "#020617",
|
|
9197
|
+
// Gray
|
|
9198
|
+
"gray-50": "#F9FAFB",
|
|
9199
|
+
"gray-100": "#F3F4F6",
|
|
9200
|
+
"gray-200": "#E5E7EB",
|
|
9201
|
+
"gray-300": "#D1D5DB",
|
|
9202
|
+
"gray-400": "#9CA3AF",
|
|
9203
|
+
"gray-500": "#6B7280",
|
|
9204
|
+
"gray-600": "#4B5563",
|
|
9205
|
+
"gray-700": "#374151",
|
|
9206
|
+
"gray-800": "#1F2937",
|
|
9207
|
+
"gray-900": "#111827",
|
|
9208
|
+
"gray-950": "#030712",
|
|
9209
|
+
// Zinc
|
|
9210
|
+
"zinc-50": "#FAFAFA",
|
|
9211
|
+
"zinc-100": "#F4F4F5",
|
|
9212
|
+
"zinc-200": "#E4E4E7",
|
|
9213
|
+
"zinc-300": "#D4D4D8",
|
|
9214
|
+
"zinc-400": "#A1A1AA",
|
|
9215
|
+
"zinc-500": "#71717A",
|
|
9216
|
+
"zinc-600": "#52525B",
|
|
9217
|
+
"zinc-700": "#3F3F46",
|
|
9218
|
+
"zinc-800": "#27272A",
|
|
9219
|
+
"zinc-900": "#18181B",
|
|
9220
|
+
"zinc-950": "#09090B",
|
|
9221
|
+
// Neutral
|
|
9222
|
+
"neutral-50": "#FAFAFA",
|
|
9223
|
+
"neutral-100": "#F5F5F5",
|
|
9224
|
+
"neutral-200": "#E5E5E5",
|
|
9225
|
+
"neutral-300": "#D4D4D4",
|
|
9226
|
+
"neutral-400": "#A3A3A3",
|
|
9227
|
+
"neutral-500": "#737373",
|
|
9228
|
+
"neutral-600": "#525252",
|
|
9229
|
+
"neutral-700": "#404040",
|
|
9230
|
+
"neutral-800": "#262626",
|
|
9231
|
+
"neutral-900": "#171717",
|
|
9232
|
+
"neutral-950": "#0A0A0A",
|
|
9233
|
+
// Stone
|
|
9234
|
+
"stone-50": "#FAFAF9",
|
|
9235
|
+
"stone-100": "#F5F5F4",
|
|
9236
|
+
"stone-200": "#E7E5E4",
|
|
9237
|
+
"stone-300": "#D6D3D1",
|
|
9238
|
+
"stone-400": "#A8A29E",
|
|
9239
|
+
"stone-500": "#78716C",
|
|
9240
|
+
"stone-600": "#57534E",
|
|
9241
|
+
"stone-700": "#44403C",
|
|
9242
|
+
"stone-800": "#292524",
|
|
9243
|
+
"stone-900": "#1C1917",
|
|
9244
|
+
"stone-950": "#0C0A09"
|
|
9245
|
+
},
|
|
9246
|
+
// 8. Z-INDEX: Stacking Order
|
|
9247
|
+
zIndex: {
|
|
9248
|
+
"base": "0",
|
|
9249
|
+
"low": "10",
|
|
9250
|
+
"mid": "50",
|
|
9251
|
+
"high": "100",
|
|
9252
|
+
"top": "9999"
|
|
9253
|
+
}
|
|
9254
|
+
},
|
|
9255
|
+
// Extend or override defaults
|
|
9256
|
+
extend: {}
|
|
9257
|
+
};
|
|
9258
|
+
function deepMerge(target, source, visited = /* @__PURE__ */ new WeakSet()) {
|
|
9259
|
+
if (visited.has(target) || visited.has(source)) {
|
|
9260
|
+
return source;
|
|
9261
|
+
}
|
|
9262
|
+
visited.add(target);
|
|
9263
|
+
visited.add(source);
|
|
9264
|
+
const result = { ...target };
|
|
9265
|
+
for (const key of Object.keys(source)) {
|
|
9266
|
+
if (source[key] && typeof source[key] === "object" && !Array.isArray(source[key])) {
|
|
9267
|
+
result[key] = deepMerge(result[key] || {}, source[key], visited);
|
|
8648
9268
|
} else {
|
|
8649
|
-
|
|
9269
|
+
result[key] = source[key];
|
|
8650
9270
|
}
|
|
8651
|
-
|
|
8652
|
-
|
|
8653
|
-
|
|
8654
|
-
|
|
8655
|
-
|
|
9271
|
+
}
|
|
9272
|
+
return result;
|
|
9273
|
+
}
|
|
9274
|
+
function mergeConfig(userConfig = {}) {
|
|
9275
|
+
const merged = { ...defaultConfig };
|
|
9276
|
+
if (userConfig.content) {
|
|
9277
|
+
merged.content = userConfig.content;
|
|
9278
|
+
}
|
|
9279
|
+
if (userConfig.output) {
|
|
9280
|
+
merged.output = { ...merged.output, ...userConfig.output };
|
|
9281
|
+
}
|
|
9282
|
+
if (userConfig.darkMode !== void 0) {
|
|
9283
|
+
merged.darkMode = userConfig.darkMode;
|
|
9284
|
+
}
|
|
9285
|
+
if (userConfig.preflight !== void 0) {
|
|
9286
|
+
merged.preflight = userConfig.preflight;
|
|
9287
|
+
}
|
|
9288
|
+
if (userConfig.theme) {
|
|
9289
|
+
merged.theme = deepMerge(merged.theme, userConfig.theme);
|
|
9290
|
+
}
|
|
9291
|
+
return merged;
|
|
9292
|
+
}
|
|
9293
|
+
|
|
9294
|
+
// src/cdn/senangstart-engine.js
|
|
9295
|
+
(function() {
|
|
9296
|
+
"use strict";
|
|
9297
|
+
function validateConfig(config) {
|
|
9298
|
+
if (!config || typeof config !== "object" || Array.isArray(config)) return false;
|
|
9299
|
+
if (config.theme && (typeof config.theme !== "object" || Array.isArray(config.theme))) return false;
|
|
9300
|
+
return true;
|
|
9301
|
+
}
|
|
9302
|
+
function loadInlineConfig() {
|
|
9303
|
+
const configEl = document.querySelector('script[type="senangstart/config"]');
|
|
9304
|
+
if (!configEl) return {};
|
|
9305
|
+
try {
|
|
9306
|
+
const parsed = JSON.parse(configEl.textContent);
|
|
9307
|
+
if (!validateConfig(parsed)) {
|
|
9308
|
+
console.error("[SenangStart] Invalid config structure");
|
|
9309
|
+
return {};
|
|
8656
9310
|
}
|
|
9311
|
+
return parsed;
|
|
9312
|
+
} catch (e) {
|
|
9313
|
+
console.error("[SenangStart] Invalid config JSON:", e);
|
|
9314
|
+
return {};
|
|
8657
9315
|
}
|
|
8658
|
-
|
|
8659
|
-
|
|
9316
|
+
}
|
|
9317
|
+
function getFinalConfig() {
|
|
9318
|
+
const user = loadInlineConfig();
|
|
9319
|
+
return mergeConfig(user);
|
|
8660
9320
|
}
|
|
8661
9321
|
function scanDOM() {
|
|
8662
9322
|
const tokens = {
|
|
8663
9323
|
layout: /* @__PURE__ */ new Set(),
|
|
8664
9324
|
space: /* @__PURE__ */ new Set(),
|
|
8665
|
-
visual: /* @__PURE__ */ new Set()
|
|
9325
|
+
visual: /* @__PURE__ */ new Set(),
|
|
9326
|
+
interact: /* @__PURE__ */ new Set(),
|
|
9327
|
+
// Collected interact IDs
|
|
9328
|
+
listens: /* @__PURE__ */ new Set()
|
|
9329
|
+
// Collected listens IDs
|
|
8666
9330
|
};
|
|
8667
|
-
const elements = document.querySelectorAll("[layout], [space], [visual]");
|
|
9331
|
+
const elements = document.querySelectorAll("[layout], [space], [visual], [interact], [listens]");
|
|
8668
9332
|
elements.forEach((el) => {
|
|
8669
9333
|
["layout", "space", "visual"].forEach((attr) => {
|
|
8670
9334
|
const value = el.getAttribute(attr);
|
|
@@ -8674,100 +9338,20 @@ video {
|
|
|
8674
9338
|
});
|
|
8675
9339
|
}
|
|
8676
9340
|
});
|
|
9341
|
+
["interact", "listens"].forEach((attr) => {
|
|
9342
|
+
const value = el.getAttribute(attr);
|
|
9343
|
+
if (value) {
|
|
9344
|
+
value.split(/\s+/).forEach((id) => {
|
|
9345
|
+
if (id) tokens[attr].add(id);
|
|
9346
|
+
});
|
|
9347
|
+
}
|
|
9348
|
+
});
|
|
8677
9349
|
});
|
|
8678
9350
|
return tokens;
|
|
8679
9351
|
}
|
|
8680
|
-
function compileCSS(
|
|
8681
|
-
|
|
8682
|
-
|
|
8683
|
-
css += generatePreflight();
|
|
8684
|
-
}
|
|
8685
|
-
const tokenArray = [];
|
|
8686
|
-
for (const [attrType, values] of Object.entries(tokens)) {
|
|
8687
|
-
for (const raw of values) {
|
|
8688
|
-
tokenArray.push({ raw, attrType });
|
|
8689
|
-
}
|
|
8690
|
-
}
|
|
8691
|
-
const baseTokens = [];
|
|
8692
|
-
const darkTokens = [];
|
|
8693
|
-
const breakpointTokens = {};
|
|
8694
|
-
const { screens } = config.theme;
|
|
8695
|
-
for (const bp of Object.keys(screens)) {
|
|
8696
|
-
breakpointTokens[bp] = [];
|
|
8697
|
-
}
|
|
8698
|
-
for (const token of tokenArray) {
|
|
8699
|
-
const parsed = tokenize(token.raw, token.attrType);
|
|
8700
|
-
if (parsed.state === "dark") {
|
|
8701
|
-
darkTokens.push(parsed);
|
|
8702
|
-
} else if (parsed.breakpoint) {
|
|
8703
|
-
if (!breakpointTokens[parsed.breakpoint]) {
|
|
8704
|
-
breakpointTokens[parsed.breakpoint] = [];
|
|
8705
|
-
}
|
|
8706
|
-
breakpointTokens[parsed.breakpoint].push(parsed);
|
|
8707
|
-
} else {
|
|
8708
|
-
baseTokens.push(parsed);
|
|
8709
|
-
}
|
|
8710
|
-
}
|
|
8711
|
-
const displayProps = ["flex", "grid", "inline-flex", "inline-grid", "block", "inline", "hidden", "contents"];
|
|
8712
|
-
const baseDisplayTokens = /* @__PURE__ */ new Map();
|
|
8713
|
-
for (const token of baseTokens) {
|
|
8714
|
-
if (token.attrType && displayProps.includes(token.property)) {
|
|
8715
|
-
if (!baseDisplayTokens.has(token.attrType)) {
|
|
8716
|
-
baseDisplayTokens.set(token.attrType, /* @__PURE__ */ new Set());
|
|
8717
|
-
}
|
|
8718
|
-
baseDisplayTokens.get(token.attrType).add(token.raw);
|
|
8719
|
-
}
|
|
8720
|
-
}
|
|
8721
|
-
for (const token of baseTokens) {
|
|
8722
|
-
css += generateRule(token.raw, token.attrType);
|
|
8723
|
-
}
|
|
8724
|
-
for (const [bp, bpTokens] of Object.entries(breakpointTokens)) {
|
|
8725
|
-
if (bpTokens.length > 0) {
|
|
8726
|
-
css += `
|
|
8727
|
-
@media (min-width: ${screens[bp]}) {
|
|
8728
|
-
`;
|
|
8729
|
-
const processedResetSelectors = /* @__PURE__ */ new Set();
|
|
8730
|
-
for (const bpToken of bpTokens) {
|
|
8731
|
-
if (bpToken.attrType && displayProps.includes(bpToken.property)) {
|
|
8732
|
-
if (baseDisplayTokens.has(bpToken.attrType)) {
|
|
8733
|
-
const baseDisplays = baseDisplayTokens.get(bpToken.attrType);
|
|
8734
|
-
if (baseDisplays.size > 0 && !baseDisplays.has(bpToken.raw) && !processedResetSelectors.has(bpToken.raw)) {
|
|
8735
|
-
const selector = `[${bpToken.attrType}~="${bpToken.raw}"]`;
|
|
8736
|
-
css += ` ${selector} { display: revert-layer; }
|
|
8737
|
-
`;
|
|
8738
|
-
processedResetSelectors.add(bpToken.raw);
|
|
8739
|
-
}
|
|
8740
|
-
}
|
|
8741
|
-
}
|
|
8742
|
-
}
|
|
8743
|
-
for (const token of bpTokens) {
|
|
8744
|
-
css += " " + generateRule(token.raw, token.attrType);
|
|
8745
|
-
}
|
|
8746
|
-
css += "}\n";
|
|
8747
|
-
}
|
|
8748
|
-
}
|
|
8749
|
-
if (darkTokens.length > 0) {
|
|
8750
|
-
const darkMode = config.darkMode || "media";
|
|
8751
|
-
if (darkMode === "media") {
|
|
8752
|
-
css += `
|
|
8753
|
-
@media (prefers-color-scheme: dark) {
|
|
8754
|
-
`;
|
|
8755
|
-
for (const token of darkTokens) {
|
|
8756
|
-
css += " " + generateRule(token.raw, token.attrType);
|
|
8757
|
-
}
|
|
8758
|
-
css += "}\n";
|
|
8759
|
-
} else {
|
|
8760
|
-
const darkSelector = Array.isArray(darkMode) ? darkMode[1] : ".dark";
|
|
8761
|
-
css += `
|
|
8762
|
-
/* Dark Mode */
|
|
8763
|
-
`;
|
|
8764
|
-
for (const token of darkTokens) {
|
|
8765
|
-
const rule = generateRule(token.raw, token.attrType);
|
|
8766
|
-
css += rule.replace(/^(\[[^\]]+\])/, `${darkSelector} $1`);
|
|
8767
|
-
}
|
|
8768
|
-
}
|
|
8769
|
-
}
|
|
8770
|
-
return css;
|
|
9352
|
+
function compileCSS(domTokens, config) {
|
|
9353
|
+
const tokens = tokenizeAll(domTokens);
|
|
9354
|
+
return generateCSS(tokens, config);
|
|
8771
9355
|
}
|
|
8772
9356
|
function injectStyles(css) {
|
|
8773
9357
|
let styleEl = document.getElementById("senangstart-jit");
|
|
@@ -8779,8 +9363,7 @@ video {
|
|
|
8779
9363
|
styleEl.textContent = css;
|
|
8780
9364
|
}
|
|
8781
9365
|
function init() {
|
|
8782
|
-
const
|
|
8783
|
-
const config = mergeConfig(userConfig);
|
|
9366
|
+
const config = getFinalConfig();
|
|
8784
9367
|
const tokens = scanDOM();
|
|
8785
9368
|
const css = compileCSS(tokens, config);
|
|
8786
9369
|
injectStyles(css);
|
|
@@ -8793,7 +9376,7 @@ video {
|
|
|
8793
9376
|
childList: true,
|
|
8794
9377
|
subtree: true,
|
|
8795
9378
|
attributes: true,
|
|
8796
|
-
attributeFilter: ["layout", "space", "visual"]
|
|
9379
|
+
attributeFilter: ["layout", "space", "visual", "interact", "listens"]
|
|
8797
9380
|
});
|
|
8798
9381
|
console.log(
|
|
8799
9382
|
"%c[SenangStart CSS]%c Just-in-Time runtime initialized \u2713",
|