@webmate-studio/builder 0.2.160 → 0.2.163
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 +41 -4
package/package.json
CHANGED
|
@@ -16,7 +16,8 @@ import {
|
|
|
16
16
|
DEFAULT_SURFACE_TOKENS,
|
|
17
17
|
defaultDesignTokensV2,
|
|
18
18
|
normalizeShadowValue,
|
|
19
|
-
isGradientValue
|
|
19
|
+
isGradientValue,
|
|
20
|
+
SHADOW_PRESETS
|
|
20
21
|
} from './design-tokens-v2.js';
|
|
21
22
|
|
|
22
23
|
|
|
@@ -54,6 +55,7 @@ export function generateTailwindV4ThemeV2(tokens) {
|
|
|
54
55
|
globalStyles += generateTextResponsiveVariants(t);
|
|
55
56
|
globalStyles += generateButtonClasses(t);
|
|
56
57
|
globalStyles += generateSpacingStyles(t);
|
|
58
|
+
globalStyles += generateShadowStyles(t);
|
|
57
59
|
globalStyles += generateResponsiveMediaQueries(responsiveLines);
|
|
58
60
|
|
|
59
61
|
return { themeVars, globalStyles };
|
|
@@ -116,15 +118,18 @@ function generateColorVariables(t, lines) {
|
|
|
116
118
|
}
|
|
117
119
|
}
|
|
118
120
|
|
|
119
|
-
// on-{welt} Kontrastfarben
|
|
121
|
+
// on-{welt} Kontrastfarben (überschreibbar via semanticMappings.textOn)
|
|
120
122
|
const neutralScale = t.colors.neutral?.scale;
|
|
121
123
|
if (neutralScale) {
|
|
122
|
-
lines.push(' /* on-colors
|
|
124
|
+
lines.push(' /* on-colors */');
|
|
123
125
|
for (const world of SEMANTIC_COLOR_WORLDS) {
|
|
124
126
|
const color = t.colors[world];
|
|
125
127
|
if (!color?.scale?.[9]) continue;
|
|
126
128
|
|
|
127
|
-
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);
|
|
128
133
|
lines.push(` --color-on-${world}: ${onColor};`);
|
|
129
134
|
}
|
|
130
135
|
}
|
|
@@ -1023,6 +1028,24 @@ function generateLayoutVariables(t, lines) {
|
|
|
1023
1028
|
if (t.borderWidth) lines.push(` --border-width: ${t.borderWidth};`);
|
|
1024
1029
|
if (t.borderRadius) lines.push(` --radius: ${t.borderRadius};`);
|
|
1025
1030
|
|
|
1031
|
+
// Tailwind v4 base spacing (used by px-*, py-*, gap-*, m-*, p-*, etc.)
|
|
1032
|
+
lines.push(` --spacing: 0.25rem;`);
|
|
1033
|
+
|
|
1034
|
+
// Tailwind v4 container widths (used by max-w-sm, max-w-md, max-w-lg, etc.)
|
|
1035
|
+
lines.push(` --container-3xs: 16rem;`);
|
|
1036
|
+
lines.push(` --container-2xs: 18rem;`);
|
|
1037
|
+
lines.push(` --container-xs: 20rem;`);
|
|
1038
|
+
lines.push(` --container-sm: 24rem;`);
|
|
1039
|
+
lines.push(` --container-md: 28rem;`);
|
|
1040
|
+
lines.push(` --container-lg: 32rem;`);
|
|
1041
|
+
lines.push(` --container-xl: 36rem;`);
|
|
1042
|
+
lines.push(` --container-2xl: 42rem;`);
|
|
1043
|
+
lines.push(` --container-3xl: 48rem;`);
|
|
1044
|
+
lines.push(` --container-4xl: 56rem;`);
|
|
1045
|
+
lines.push(` --container-5xl: 64rem;`);
|
|
1046
|
+
lines.push(` --container-6xl: 72rem;`);
|
|
1047
|
+
lines.push(` --container-7xl: 80rem;`);
|
|
1048
|
+
|
|
1026
1049
|
if (t.spacing?.component) {
|
|
1027
1050
|
lines.push(` /* component spacing */`);
|
|
1028
1051
|
lines.push(` --spacing-component: ${t.spacing.component.base || '3rem'};`);
|
|
@@ -1073,6 +1096,20 @@ function generateSpacingStyles(t) {
|
|
|
1073
1096
|
}
|
|
1074
1097
|
|
|
1075
1098
|
|
|
1099
|
+
// ─── Shadow-Utilities ───────────────────────────────────────────────────────
|
|
1100
|
+
|
|
1101
|
+
function generateShadowStyles(t) {
|
|
1102
|
+
let css = '\n\n/* Shadow Utilities */';
|
|
1103
|
+
|
|
1104
|
+
for (const [name, value] of Object.entries(SHADOW_PRESETS)) {
|
|
1105
|
+
const resolved = resolveShadowToCSS(value, t);
|
|
1106
|
+
css += `\n.shadow-${name} { box-shadow: ${resolved}; }`;
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
return css;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
|
|
1076
1113
|
// ─── Basis-Styles ───────────────────────────────────────────────────────────
|
|
1077
1114
|
|
|
1078
1115
|
function generateBaseStyles(t) {
|