@webmate-studio/builder 0.2.98 → 0.2.99
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.js +43 -0
package/package.json
CHANGED
package/src/design-tokens.js
CHANGED
|
@@ -602,6 +602,18 @@ export const defaultDesignTokens = {
|
|
|
602
602
|
opacity: 100,
|
|
603
603
|
opacityHover: 100
|
|
604
604
|
}
|
|
605
|
+
},
|
|
606
|
+
|
|
607
|
+
// Spacing between components
|
|
608
|
+
spacing: {
|
|
609
|
+
component: {
|
|
610
|
+
base: '3rem', // 48px - Mobile
|
|
611
|
+
sm: '3rem', // 48px - 640px+
|
|
612
|
+
md: '3.5rem', // 56px - 768px+
|
|
613
|
+
lg: '4rem', // 64px - 1024px+
|
|
614
|
+
xl: '4.5rem', // 72px - 1280px+
|
|
615
|
+
'2xl': '5rem' // 80px - 1536px+
|
|
616
|
+
}
|
|
605
617
|
}
|
|
606
618
|
};
|
|
607
619
|
|
|
@@ -1555,5 +1567,36 @@ export function generateCSSFromTokens(tokens) {
|
|
|
1555
1567
|
lines.push(semanticUtilities);
|
|
1556
1568
|
}
|
|
1557
1569
|
|
|
1570
|
+
// Add component spacing utilities
|
|
1571
|
+
if (tokens.spacing?.component) {
|
|
1572
|
+
lines.push('');
|
|
1573
|
+
lines.push('/* Component Spacing */');
|
|
1574
|
+
lines.push('.component-wrapper {');
|
|
1575
|
+
lines.push(' display: flex;');
|
|
1576
|
+
lines.push(' flex-direction: column;');
|
|
1577
|
+
lines.push(` gap: ${tokens.spacing.component.base || '3rem'};`);
|
|
1578
|
+
lines.push('}');
|
|
1579
|
+
|
|
1580
|
+
// Responsive spacing
|
|
1581
|
+
const breakpoints = {
|
|
1582
|
+
sm: '640px',
|
|
1583
|
+
md: '768px',
|
|
1584
|
+
lg: '1024px',
|
|
1585
|
+
xl: '1280px',
|
|
1586
|
+
'2xl': '1536px'
|
|
1587
|
+
};
|
|
1588
|
+
|
|
1589
|
+
for (const [breakpoint, minWidth] of Object.entries(breakpoints)) {
|
|
1590
|
+
if (tokens.spacing.component[breakpoint]) {
|
|
1591
|
+
lines.push('');
|
|
1592
|
+
lines.push(`@media (min-width: ${minWidth}) {`);
|
|
1593
|
+
lines.push(' .component-wrapper {');
|
|
1594
|
+
lines.push(` gap: ${tokens.spacing.component[breakpoint]};`);
|
|
1595
|
+
lines.push(' }');
|
|
1596
|
+
lines.push('}');
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
|
|
1558
1601
|
return lines.join('\n');
|
|
1559
1602
|
}
|