@webmate-studio/builder 0.2.161 → 0.2.164
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/package.json +1 -1
- package/src/design-tokens-v2-css.js +108 -3
package/package.json
CHANGED
|
@@ -118,15 +118,18 @@ function generateColorVariables(t, lines) {
|
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
120
|
|
|
121
|
-
// on-{welt} Kontrastfarben
|
|
121
|
+
// on-{welt} Kontrastfarben (überschreibbar via semanticMappings.textOn)
|
|
122
122
|
const neutralScale = t.colors.neutral?.scale;
|
|
123
123
|
if (neutralScale) {
|
|
124
|
-
lines.push(' /* on-colors
|
|
124
|
+
lines.push(' /* on-colors */');
|
|
125
125
|
for (const world of SEMANTIC_COLOR_WORLDS) {
|
|
126
126
|
const color = t.colors[world];
|
|
127
127
|
if (!color?.scale?.[9]) continue;
|
|
128
128
|
|
|
129
|
-
const
|
|
129
|
+
const textOnOverride = t.semanticMappings?.[world]?.textOn;
|
|
130
|
+
const onColor = textOnOverride
|
|
131
|
+
? (neutralScale[textOnOverride] || calculateOnColor(color.scale[9], neutralScale))
|
|
132
|
+
: calculateOnColor(color.scale[9], neutralScale);
|
|
130
133
|
lines.push(` --color-on-${world}: ${onColor};`);
|
|
131
134
|
}
|
|
132
135
|
}
|
|
@@ -1025,6 +1028,108 @@ function generateLayoutVariables(t, lines) {
|
|
|
1025
1028
|
if (t.borderWidth) lines.push(` --border-width: ${t.borderWidth};`);
|
|
1026
1029
|
if (t.borderRadius) lines.push(` --radius: ${t.borderRadius};`);
|
|
1027
1030
|
|
|
1031
|
+
// ── Tailwind v4 default theme variables ──
|
|
1032
|
+
// These are normally set by @theme in a Tailwind build.
|
|
1033
|
+
// Since our preview loads pre-built component CSS that references these vars,
|
|
1034
|
+
// we must define them here so the utilities work correctly.
|
|
1035
|
+
|
|
1036
|
+
// Spacing (px-*, py-*, gap-*, m-*, p-*, w-*, h-*, etc.)
|
|
1037
|
+
lines.push(` --spacing: 0.25rem;`);
|
|
1038
|
+
|
|
1039
|
+
// Border radius (rounded-sm, rounded-lg, etc.)
|
|
1040
|
+
lines.push(` --radius-xs: 0.125rem;`);
|
|
1041
|
+
lines.push(` --radius-sm: 0.25rem;`);
|
|
1042
|
+
lines.push(` --radius-md: 0.375rem;`);
|
|
1043
|
+
lines.push(` --radius-lg: 0.5rem;`);
|
|
1044
|
+
lines.push(` --radius-xl: 0.75rem;`);
|
|
1045
|
+
lines.push(` --radius-2xl: 1rem;`);
|
|
1046
|
+
lines.push(` --radius-3xl: 1.5rem;`);
|
|
1047
|
+
lines.push(` --radius-4xl: 2rem;`);
|
|
1048
|
+
|
|
1049
|
+
// Font sizes (text-xs, text-sm, text-base, text-lg, text-xl, etc.)
|
|
1050
|
+
lines.push(` --text-xs: 0.75rem;`);
|
|
1051
|
+
lines.push(` --text-xs--line-height: 1rem;`);
|
|
1052
|
+
lines.push(` --text-sm: 0.875rem;`);
|
|
1053
|
+
lines.push(` --text-sm--line-height: 1.25rem;`);
|
|
1054
|
+
lines.push(` --text-base: 1rem;`);
|
|
1055
|
+
lines.push(` --text-base--line-height: 1.5rem;`);
|
|
1056
|
+
lines.push(` --text-lg: 1.125rem;`);
|
|
1057
|
+
lines.push(` --text-lg--line-height: 1.75rem;`);
|
|
1058
|
+
lines.push(` --text-xl: 1.25rem;`);
|
|
1059
|
+
lines.push(` --text-xl--line-height: 1.75rem;`);
|
|
1060
|
+
lines.push(` --text-2xl: 1.5rem;`);
|
|
1061
|
+
lines.push(` --text-2xl--line-height: 2rem;`);
|
|
1062
|
+
lines.push(` --text-3xl: 1.875rem;`);
|
|
1063
|
+
lines.push(` --text-3xl--line-height: 2.25rem;`);
|
|
1064
|
+
lines.push(` --text-4xl: 2.25rem;`);
|
|
1065
|
+
lines.push(` --text-4xl--line-height: 2.5rem;`);
|
|
1066
|
+
lines.push(` --text-5xl: 3rem;`);
|
|
1067
|
+
lines.push(` --text-5xl--line-height: 1;`);
|
|
1068
|
+
lines.push(` --text-6xl: 3.75rem;`);
|
|
1069
|
+
lines.push(` --text-6xl--line-height: 1;`);
|
|
1070
|
+
lines.push(` --text-7xl: 4.5rem;`);
|
|
1071
|
+
lines.push(` --text-7xl--line-height: 1;`);
|
|
1072
|
+
lines.push(` --text-8xl: 6rem;`);
|
|
1073
|
+
lines.push(` --text-8xl--line-height: 1;`);
|
|
1074
|
+
lines.push(` --text-9xl: 8rem;`);
|
|
1075
|
+
lines.push(` --text-9xl--line-height: 1;`);
|
|
1076
|
+
|
|
1077
|
+
// Font weight (font-thin, font-light, font-normal, font-bold, etc.)
|
|
1078
|
+
lines.push(` --font-weight-thin: 100;`);
|
|
1079
|
+
lines.push(` --font-weight-extralight: 200;`);
|
|
1080
|
+
lines.push(` --font-weight-light: 300;`);
|
|
1081
|
+
lines.push(` --font-weight-normal: 400;`);
|
|
1082
|
+
lines.push(` --font-weight-medium: 500;`);
|
|
1083
|
+
lines.push(` --font-weight-semibold: 600;`);
|
|
1084
|
+
lines.push(` --font-weight-bold: 700;`);
|
|
1085
|
+
lines.push(` --font-weight-extrabold: 800;`);
|
|
1086
|
+
lines.push(` --font-weight-black: 900;`);
|
|
1087
|
+
|
|
1088
|
+
// Line height (leading-none, leading-tight, leading-normal, etc.)
|
|
1089
|
+
lines.push(` --leading-none: 1;`);
|
|
1090
|
+
lines.push(` --leading-tight: 1.25;`);
|
|
1091
|
+
lines.push(` --leading-snug: 1.375;`);
|
|
1092
|
+
lines.push(` --leading-normal: 1.5;`);
|
|
1093
|
+
lines.push(` --leading-relaxed: 1.625;`);
|
|
1094
|
+
lines.push(` --leading-loose: 2;`);
|
|
1095
|
+
|
|
1096
|
+
// Letter spacing (tracking-tighter, tracking-tight, tracking-normal, etc.)
|
|
1097
|
+
lines.push(` --tracking-tighter: -0.05em;`);
|
|
1098
|
+
lines.push(` --tracking-tight: -0.025em;`);
|
|
1099
|
+
lines.push(` --tracking-normal: 0em;`);
|
|
1100
|
+
lines.push(` --tracking-wide: 0.025em;`);
|
|
1101
|
+
lines.push(` --tracking-wider: 0.05em;`);
|
|
1102
|
+
lines.push(` --tracking-widest: 0.1em;`);
|
|
1103
|
+
|
|
1104
|
+
// Shadows (shadow-sm, shadow, shadow-md, shadow-lg, shadow-xl, shadow-2xl)
|
|
1105
|
+
lines.push(` --shadow-2xs: 0 1px rgba(0,0,0,0.05);`);
|
|
1106
|
+
lines.push(` --shadow-xs: 0 1px 2px rgba(0,0,0,0.05);`);
|
|
1107
|
+
lines.push(` --shadow-sm: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);`);
|
|
1108
|
+
lines.push(` --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);`);
|
|
1109
|
+
lines.push(` --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);`);
|
|
1110
|
+
lines.push(` --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1), 0 8px 10px -6px rgba(0,0,0,0.1);`);
|
|
1111
|
+
lines.push(` --shadow-2xl: 0 25px 50px -12px rgba(0,0,0,0.25);`);
|
|
1112
|
+
|
|
1113
|
+
// Inset shadows (inset-shadow-xs, inset-shadow-sm)
|
|
1114
|
+
lines.push(` --inset-shadow-2xs: inset 0 1px rgba(0,0,0,0.05);`);
|
|
1115
|
+
lines.push(` --inset-shadow-xs: inset 0 1px 1px rgba(0,0,0,0.05);`);
|
|
1116
|
+
lines.push(` --inset-shadow-sm: inset 0 2px 4px rgba(0,0,0,0.05);`);
|
|
1117
|
+
|
|
1118
|
+
// Container widths (max-w-sm, max-w-md, max-w-lg, etc.)
|
|
1119
|
+
lines.push(` --container-3xs: 16rem;`);
|
|
1120
|
+
lines.push(` --container-2xs: 18rem;`);
|
|
1121
|
+
lines.push(` --container-xs: 20rem;`);
|
|
1122
|
+
lines.push(` --container-sm: 24rem;`);
|
|
1123
|
+
lines.push(` --container-md: 28rem;`);
|
|
1124
|
+
lines.push(` --container-lg: 32rem;`);
|
|
1125
|
+
lines.push(` --container-xl: 36rem;`);
|
|
1126
|
+
lines.push(` --container-2xl: 42rem;`);
|
|
1127
|
+
lines.push(` --container-3xl: 48rem;`);
|
|
1128
|
+
lines.push(` --container-4xl: 56rem;`);
|
|
1129
|
+
lines.push(` --container-5xl: 64rem;`);
|
|
1130
|
+
lines.push(` --container-6xl: 72rem;`);
|
|
1131
|
+
lines.push(` --container-7xl: 80rem;`);
|
|
1132
|
+
|
|
1028
1133
|
if (t.spacing?.component) {
|
|
1029
1134
|
lines.push(` /* component spacing */`);
|
|
1030
1135
|
lines.push(` --spacing-component: ${t.spacing.component.base || '3rem'};`);
|