@webmate-studio/builder 0.2.73 → 0.2.75

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webmate-studio/builder",
3
- "version": "0.2.73",
3
+ "version": "0.2.75",
4
4
  "type": "module",
5
5
  "description": "Webmate Studio Component Builder",
6
6
  "keywords": [
@@ -514,6 +514,7 @@ export const defaultDesignTokens = {
514
514
  */
515
515
  export function generateTailwindV4Theme(tokens) {
516
516
  const lines = [];
517
+ const responsiveLines = {}; // { sm: [...], md: [...], lg: [...], xl: [...], '2xl': [...] }
517
518
 
518
519
  // Colors - Map to Tailwind v4 CSS variables
519
520
  if (tokens.colors) {
@@ -680,7 +681,12 @@ export function generateTailwindV4Theme(tokens) {
680
681
 
681
682
  // Text color (not responsive)
682
683
  if (style.textColor) {
683
- lines.push(` --text-${kebabName}-color: var(--color-${style.textColor});`);
684
+ // Convert textColor to kebab-case (textBase -> text-base)
685
+ const colorKebab = style.textColor
686
+ .replace(/([A-Z])/g, '-$1')
687
+ .toLowerCase()
688
+ .replace(/^-/, '');
689
+ lines.push(` --text-${kebabName}-color: var(--color-${colorKebab});`);
684
690
  }
685
691
  }
686
692
  }
@@ -857,47 +863,19 @@ body {
857
863
  }
858
864
 
859
865
  // Add responsive media queries for textStyles (OUTSIDE @theme block!)
860
- if (tokens.textStyles) {
861
- const breakpointKeys = ['sm', 'md', 'lg', 'xl', '2xl'];
862
- const breakpointValues = {
863
- sm: '640px',
864
- md: '768px',
865
- lg: '1024px',
866
- xl: '1280px',
867
- '2xl': '1536px'
868
- };
869
-
870
- for (const bp of breakpointKeys) {
871
- const mediaQueryLines = [];
872
-
873
- for (const [styleName, style] of Object.entries(tokens.textStyles)) {
874
- const kebabName = styleName
875
- .replace(/([A-Z])/g, '-$1')
876
- .replace(/(\d+)/g, '-$1')
877
- .toLowerCase()
878
- .replace(/^-/, '');
879
-
880
- // Font size
881
- if (style.fontSize && typeof style.fontSize === 'object' && style.fontSize[bp]) {
882
- mediaQueryLines.push(` --text-${kebabName}-font-size: ${style.fontSize[bp]};`);
883
- }
884
-
885
- // Line height
886
- if (style.lineHeight && typeof style.lineHeight === 'object' && style.lineHeight[bp]) {
887
- mediaQueryLines.push(` --text-${kebabName}-line-height: ${style.lineHeight[bp]};`);
888
- }
889
-
890
- // Letter spacing
891
- if (style.letterSpacing && typeof style.letterSpacing === 'object' && style.letterSpacing[bp]) {
892
- mediaQueryLines.push(` --text-${kebabName}-letter-spacing: ${style.letterSpacing[bp]};`);
893
- }
894
- }
866
+ const breakpointValues = {
867
+ sm: '640px',
868
+ md: '768px',
869
+ lg: '1024px',
870
+ xl: '1280px',
871
+ '2xl': '1536px'
872
+ };
895
873
 
896
- if (mediaQueryLines.length > 0) {
897
- globalStyles += `\n\n@media (min-width: ${breakpointValues[bp]}) {\n :root {\n`;
898
- globalStyles += mediaQueryLines.join('\n');
899
- globalStyles += '\n }\n}';
900
- }
874
+ for (const [bp, minWidth] of Object.entries(breakpointValues)) {
875
+ if (responsiveLines[bp] && responsiveLines[bp].length > 0) {
876
+ globalStyles += `\n\n@media (min-width: ${minWidth}) {\n :root {\n`;
877
+ globalStyles += responsiveLines[bp].join('\n');
878
+ globalStyles += '\n }\n}';
901
879
  }
902
880
  }
903
881