@webmate-studio/builder 0.2.89 → 0.2.90
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/css-deduplicator.js +10 -1
- package/src/design-tokens.js +2 -4
package/package.json
CHANGED
package/src/css-deduplicator.js
CHANGED
|
@@ -66,7 +66,8 @@ export function deduplicateCSS(cssArray) {
|
|
|
66
66
|
base: new Set(),
|
|
67
67
|
properties: new Set(),
|
|
68
68
|
theme: new Set(),
|
|
69
|
-
|
|
69
|
+
components: new Set(), // Component utilities (wrapped from utilities layer)
|
|
70
|
+
utilities: new Set() // Design token utilities (should override components)
|
|
70
71
|
};
|
|
71
72
|
const regularRules = {
|
|
72
73
|
charset: [], // @charset declarations
|
|
@@ -157,6 +158,9 @@ export function deduplicateCSS(cssArray) {
|
|
|
157
158
|
parts.push(...regularRules.imports);
|
|
158
159
|
}
|
|
159
160
|
|
|
161
|
+
// Layer order declaration (MUST be first to define precedence)
|
|
162
|
+
parts.push('@layer base, components, utilities;');
|
|
163
|
+
|
|
160
164
|
// Tailwind layers in correct order
|
|
161
165
|
if (tailwindLayers.base.size > 0) {
|
|
162
166
|
parts.push(`@layer base {\n${Array.from(tailwindLayers.base).join('\n\n')}\n}`);
|
|
@@ -167,6 +171,11 @@ export function deduplicateCSS(cssArray) {
|
|
|
167
171
|
if (tailwindLayers.theme.size > 0) {
|
|
168
172
|
parts.push(`@layer theme {\n${Array.from(tailwindLayers.theme).join('\n\n')}\n}`);
|
|
169
173
|
}
|
|
174
|
+
if (tailwindLayers.components.size > 0) {
|
|
175
|
+
// Sort component utilities by breakpoint before joining
|
|
176
|
+
const sortedComponents = sortUtilityRules(Array.from(tailwindLayers.components));
|
|
177
|
+
parts.push(`@layer components {\n${sortedComponents.join('\n\n')}\n}`);
|
|
178
|
+
}
|
|
170
179
|
if (tailwindLayers.utilities.size > 0) {
|
|
171
180
|
// Sort utilities by breakpoint before joining
|
|
172
181
|
const sortedUtilities = sortUtilityRules(Array.from(tailwindLayers.utilities));
|
package/src/design-tokens.js
CHANGED
|
@@ -1010,10 +1010,8 @@ export function generateTailwindConfig(tokens) {
|
|
|
1010
1010
|
export function generateCSSFromTokens(tokens) {
|
|
1011
1011
|
const lines = [];
|
|
1012
1012
|
|
|
1013
|
-
//
|
|
1014
|
-
|
|
1015
|
-
lines.push('@layer base, components, utilities;');
|
|
1016
|
-
lines.push('');
|
|
1013
|
+
// NOTE: @layer order declaration is now handled by css-deduplicator.js
|
|
1014
|
+
// to ensure it appears only once and in the correct position
|
|
1017
1015
|
lines.push(':root {');
|
|
1018
1016
|
|
|
1019
1017
|
// Colors
|