@webmate-studio/builder 0.2.35 → 0.2.36
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/build.js +2 -1
- package/src/tailwind-generator.js +19 -4
package/package.json
CHANGED
package/src/build.js
CHANGED
|
@@ -371,7 +371,8 @@ export async function build(options = {}) {
|
|
|
371
371
|
logger.info(`Generating Tailwind CSS for ${component.name}...`);
|
|
372
372
|
const { css, classes } = await generateComponentCSS(allHTML, {
|
|
373
373
|
minify: minify,
|
|
374
|
-
designTokens: options.designTokens // Pass design tokens to Tailwind generator
|
|
374
|
+
designTokens: options.designTokens, // Pass design tokens to Tailwind generator
|
|
375
|
+
includeBaseLayers: false // Only generate utilities, not base/theme/properties layers
|
|
375
376
|
});
|
|
376
377
|
|
|
377
378
|
// Write CSS file
|
|
@@ -104,12 +104,14 @@ function generateThemeCSS(colors, designTokens = null) {
|
|
|
104
104
|
* @param {Object} options - Generation options
|
|
105
105
|
* @param {Object} options.designTokens - Custom design tokens (optional)
|
|
106
106
|
* @param {boolean} options.minify - Minify output CSS
|
|
107
|
+
* @param {boolean} options.includeBaseLayers - Include base/theme/properties layers (default: true)
|
|
107
108
|
* @returns {Promise<string>} Generated CSS
|
|
108
109
|
*/
|
|
109
110
|
export async function generateTailwindCSS(classes, options = {}) {
|
|
110
111
|
const {
|
|
111
112
|
designTokens = null,
|
|
112
|
-
minify = true
|
|
113
|
+
minify = true,
|
|
114
|
+
includeBaseLayers = true
|
|
113
115
|
} = options;
|
|
114
116
|
|
|
115
117
|
const classArray = Array.isArray(classes) ? classes : Array.from(classes);
|
|
@@ -250,12 +252,25 @@ export async function generateTailwindCSS(classes, options = {}) {
|
|
|
250
252
|
}
|
|
251
253
|
|
|
252
254
|
// Create input CSS with Tailwind v4 syntax
|
|
253
|
-
|
|
254
|
-
|
|
255
|
+
// For component builds: only include utilities layer (no base/theme/properties)
|
|
256
|
+
// For dev builds: include everything
|
|
257
|
+
let inputCSS;
|
|
258
|
+
|
|
259
|
+
if (includeBaseLayers) {
|
|
260
|
+
// Full Tailwind with all layers (for wm dev)
|
|
261
|
+
const themeCSS = generateThemeCSS(themeColors);
|
|
262
|
+
inputCSS = `
|
|
255
263
|
@import "tailwindcss";
|
|
256
264
|
|
|
257
265
|
${themeCSS}
|
|
258
|
-
|
|
266
|
+
`.trim();
|
|
267
|
+
} else {
|
|
268
|
+
// Only utilities layer (for component builds)
|
|
269
|
+
// Base/theme/properties are provided by CMS design tokens
|
|
270
|
+
inputCSS = `
|
|
271
|
+
@import "tailwindcss" layer(utilities);
|
|
272
|
+
`.trim();
|
|
273
|
+
}
|
|
259
274
|
|
|
260
275
|
// Load Tailwind CSS styles
|
|
261
276
|
const tailwindStyles = loadTailwindStyles();
|