@webmate-studio/builder 0.2.159 → 0.2.160
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 +42 -0
package/package.json
CHANGED
|
@@ -53,6 +53,7 @@ export function generateTailwindV4ThemeV2(tokens) {
|
|
|
53
53
|
globalStyles += generateTextAliasClasses(t);
|
|
54
54
|
globalStyles += generateTextResponsiveVariants(t);
|
|
55
55
|
globalStyles += generateButtonClasses(t);
|
|
56
|
+
globalStyles += generateSpacingStyles(t);
|
|
56
57
|
globalStyles += generateResponsiveMediaQueries(responsiveLines);
|
|
57
58
|
|
|
58
59
|
return { themeVars, globalStyles };
|
|
@@ -1022,6 +1023,11 @@ function generateLayoutVariables(t, lines) {
|
|
|
1022
1023
|
if (t.borderWidth) lines.push(` --border-width: ${t.borderWidth};`);
|
|
1023
1024
|
if (t.borderRadius) lines.push(` --radius: ${t.borderRadius};`);
|
|
1024
1025
|
|
|
1026
|
+
if (t.spacing?.component) {
|
|
1027
|
+
lines.push(` /* component spacing */`);
|
|
1028
|
+
lines.push(` --spacing-component: ${t.spacing.component.base || '3rem'};`);
|
|
1029
|
+
}
|
|
1030
|
+
|
|
1025
1031
|
if (t.breakpoints) {
|
|
1026
1032
|
lines.push(' /* breakpoints */');
|
|
1027
1033
|
for (const [key, value] of Object.entries(t.breakpoints)) {
|
|
@@ -1031,6 +1037,42 @@ function generateLayoutVariables(t, lines) {
|
|
|
1031
1037
|
}
|
|
1032
1038
|
|
|
1033
1039
|
|
|
1040
|
+
// ─── Component Spacing ──────────────────────────────────────────────────────
|
|
1041
|
+
|
|
1042
|
+
function generateSpacingStyles(t) {
|
|
1043
|
+
if (!t.spacing?.component) return '';
|
|
1044
|
+
|
|
1045
|
+
const breakpoints = {
|
|
1046
|
+
sm: '640px', md: '768px', lg: '1024px', xl: '1280px', '2xl': '1536px'
|
|
1047
|
+
};
|
|
1048
|
+
|
|
1049
|
+
let css = '\n\n/* Component Spacing */';
|
|
1050
|
+
css += '\n.component-wrapper {';
|
|
1051
|
+
css += '\n display: flex;';
|
|
1052
|
+
css += '\n flex-direction: column;';
|
|
1053
|
+
css += '\n}';
|
|
1054
|
+
css += '\n.component-wrapper > * + * {';
|
|
1055
|
+
css += '\n margin-top: var(--spacing-component);';
|
|
1056
|
+
css += '\n}';
|
|
1057
|
+
|
|
1058
|
+
// Spacing-Modi
|
|
1059
|
+
css += '\n[data-spacing="none"] { margin-top: 0 !important; }';
|
|
1060
|
+
css += '\n[data-spacing="half"] { margin-top: calc(var(--spacing-component) / 2) !important; }';
|
|
1061
|
+
css += '\n[data-spacing="double"] { margin-top: calc(var(--spacing-component) * 2) !important; }';
|
|
1062
|
+
|
|
1063
|
+
// Responsive Overrides
|
|
1064
|
+
for (const [bp, minWidth] of Object.entries(breakpoints)) {
|
|
1065
|
+
if (t.spacing.component[bp]) {
|
|
1066
|
+
css += `\n@media (min-width: ${minWidth}) {`;
|
|
1067
|
+
css += `\n :root { --spacing-component: ${t.spacing.component[bp]}; }`;
|
|
1068
|
+
css += '\n}';
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
|
|
1072
|
+
return css;
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
|
|
1034
1076
|
// ─── Basis-Styles ───────────────────────────────────────────────────────────
|
|
1035
1077
|
|
|
1036
1078
|
function generateBaseStyles(t) {
|