@webmate-studio/builder 0.2.44 → 0.2.45
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/tailwind-generator.js +12 -0
package/package.json
CHANGED
|
@@ -70,6 +70,7 @@ function stripNonUtilityLayers(css) {
|
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* Extract Tailwind classes from HTML content
|
|
73
|
+
* Supports: class="...", class='...', and Svelte's class:xxx={...}
|
|
73
74
|
* @param {string} html - HTML content
|
|
74
75
|
* @returns {Set<string>} Set of unique Tailwind classes
|
|
75
76
|
*/
|
|
@@ -90,6 +91,17 @@ export function extractTailwindClasses(html) {
|
|
|
90
91
|
});
|
|
91
92
|
}
|
|
92
93
|
|
|
94
|
+
// Match Svelte conditional classes: class:xxx={...}
|
|
95
|
+
// Supports arbitrary values with brackets: class:lg:pb-[calc(10px + 30px)]={...}
|
|
96
|
+
// Same pattern as CLI preview-ui for consistency
|
|
97
|
+
const svelteClassRegex = /class:((?:[^\s=[]|\[[^\]]*\])+)=/g;
|
|
98
|
+
while ((match = svelteClassRegex.exec(html)) !== null) {
|
|
99
|
+
const className = match[1];
|
|
100
|
+
if (className.trim()) {
|
|
101
|
+
classes.add(className.trim());
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
|
|
93
105
|
return classes;
|
|
94
106
|
}
|
|
95
107
|
|