@webmate-studio/builder 0.2.93 → 0.2.95

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.93",
3
+ "version": "0.2.95",
4
4
  "type": "module",
5
5
  "description": "Webmate Studio Component Builder",
6
6
  "keywords": [
@@ -143,7 +143,18 @@ export function deduplicateCSS(cssArray) {
143
143
  duplicatesSkipped++;
144
144
  continue;
145
145
  } else {
146
- regularRules.other.push(trimmed);
146
+ // Check if this looks like a Tailwind utility class
147
+ // Pattern: .class-name { property: value; }
148
+ // Examples: .border-2, .my-4, .text-red-500, .hover\:bg-blue-500
149
+ const isTailwindUtility = /^\.[a-z][a-z0-9\-\\:]*\s*\{/.test(trimmed);
150
+
151
+ if (isTailwindUtility) {
152
+ // Treat as utility - add to utilities layer
153
+ tailwindLayers.utilities.add(trimmed);
154
+ } else {
155
+ // Component-specific styles (not utilities)
156
+ regularRules.other.push(trimmed);
157
+ }
147
158
  }
148
159
  }
149
160
  }
@@ -56,10 +56,11 @@ function stripNonUtilityLayers(css) {
56
56
  // Remove @property definitions
57
57
  css = css.replace(/@property\s+[^{]+\{[\s\S]*?\n\}/g, '');
58
58
 
59
- // Extract content from @layer utilities { ... }
60
- const utilitiesMatch = css.match(/@layer\s+utilities\s*\{([\s\S]*)\}/);
59
+ // Keep @layer utilities { ... } wrapper (needed for CSS cascade)
60
+ // Don't extract content - we want to keep the layer declaration
61
+ const utilitiesMatch = css.match(/@layer\s+utilities\s*\{[\s\S]*\}/);
61
62
  if (utilitiesMatch) {
62
- css = utilitiesMatch[1].trim();
63
+ css = utilitiesMatch[0].trim();
63
64
  }
64
65
 
65
66
  // Clean up multiple newlines