@webmate-studio/builder 0.2.47 → 0.2.49

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.47",
3
+ "version": "0.2.49",
4
4
  "type": "module",
5
5
  "description": "Webmate Studio Component Builder",
6
6
  "keywords": [
@@ -143,8 +143,29 @@ function generateThemeCSS(colors, designTokens = null) {
143
143
  }
144
144
  }
145
145
 
146
+ // Add font families if provided in design tokens
147
+ // Support both structures:
148
+ // 1. designTokens.fontFamily.{heading, body, mono}
149
+ // 2. designTokens.typography.fontFamily.{heading, body, mono}
150
+ const fontFamilies = designTokens?.fontFamily || designTokens?.typography?.fontFamily;
151
+ if (fontFamilies) {
152
+ for (const [key, value] of Object.entries(fontFamilies)) {
153
+ // value can be a string or an array
154
+ const fontValue = Array.isArray(value) ? value.join(', ') : value;
155
+ themeCSS += ` --font-${key}: ${fontValue};\n`;
156
+ }
157
+ }
158
+
146
159
  themeCSS += `}\n`;
147
160
 
161
+ // IMPORTANT: Add baseline font-family utility classes that reference CSS variables
162
+ // These classes are ALWAYS available, even if designTokens are not provided
163
+ // The actual font values come from tenant-specific design tokens (loaded separately)
164
+ themeCSS += `\n/* Font-family utilities (reference CSS variables from design tokens) */\n`;
165
+ themeCSS += `.font-heading { font-family: var(--font-heading); }\n`;
166
+ themeCSS += `.font-body { font-family: var(--font-body); }\n`;
167
+ themeCSS += `.font-mono { font-family: var(--font-mono); }\n`;
168
+
148
169
  return themeCSS;
149
170
  }
150
171