@massimo-cassandro/minimo 0.5.1 → 0.5.3
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.
|
@@ -147,9 +147,32 @@ StyleDictionary.registerFormat({
|
|
|
147
147
|
|
|
148
148
|
const resolveRefs = makeResolveRefs(tokenByPath);
|
|
149
149
|
|
|
150
|
+
const sequenceList = [
|
|
151
|
+
'xxs', 'xs', 'sm', 'base', 'md', 'lg', 'xl', 'xxl', 'xxxl', '2xl', '3xl',
|
|
152
|
+
'xlight', 'light', 'regular', 'medium', 'semibold', 'bold', 'xbold'
|
|
153
|
+
]
|
|
154
|
+
|
|
155
|
+
const sortFunction = (a, b) => {
|
|
156
|
+
const idxA = sequenceList.indexOf(a.name);
|
|
157
|
+
const idxB = sequenceList.indexOf(b.name);
|
|
158
|
+
|
|
159
|
+
// Entrambi nella lista → ordine arbitrario
|
|
160
|
+
if (idxA !== -1 && idxB !== -1) return idxA - idxB;
|
|
161
|
+
|
|
162
|
+
// Solo A nella lista → A viene prima
|
|
163
|
+
if (idxA !== -1) return -1;
|
|
164
|
+
|
|
165
|
+
// Solo B nella lista → B viene prima
|
|
166
|
+
if (idxB !== -1) return 1;
|
|
167
|
+
|
|
168
|
+
// Nessuno nella lista → ordine alfabetico
|
|
169
|
+
return a.name.localeCompare(b.name, 'en', { numeric: true, sensitivity: 'base' });
|
|
170
|
+
};
|
|
171
|
+
|
|
150
172
|
const lines = dictionary.allTokens
|
|
151
173
|
.slice()
|
|
152
|
-
.sort((a, b) => a.name.localeCompare(b.name))
|
|
174
|
+
// .sort((a, b) => a.name.localeCompare(b.name, 'en', {numeric: true, sensitivity: 'base'}))
|
|
175
|
+
.sort((a, b) => sortFunction(a,b))
|
|
153
176
|
.flatMap((token) => {
|
|
154
177
|
const type = token.$type ?? token.type;
|
|
155
178
|
const orig = token.original?.$value ?? token.original?.value;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/* eslint-disable no-console */
|
|
2
3
|
|
|
3
4
|
// build-tokens.mjs
|
|
4
5
|
// Entry point: imports modules, runs the build, lints the CSS output, prints the log.
|
|
@@ -106,7 +107,7 @@ if (penpotBuildPath) {
|
|
|
106
107
|
}
|
|
107
108
|
} else {
|
|
108
109
|
console.log(styleText(['yellow'],
|
|
109
|
-
|
|
110
|
+
'[build-tokens] penpot json : (disabled — penpotBuildPath not set)'
|
|
110
111
|
));
|
|
111
112
|
}
|
|
112
113
|
|
package/package.json
CHANGED
|
@@ -23,7 +23,7 @@ fieldset.form-group, fieldset.form-collection-fset {
|
|
|
23
23
|
*/
|
|
24
24
|
|
|
25
25
|
|
|
26
|
-
.
|
|
26
|
+
.fset { /* :not(.fupl-wrapper):not(.form-group):not(.form-collection-fset) { */
|
|
27
27
|
position: relative;
|
|
28
28
|
padding: 3rem 1rem 1rem;
|
|
29
29
|
margin: 1rem 0 2rem;
|
|
@@ -50,7 +50,7 @@ fieldset.form-group, fieldset.form-collection-fset {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
|
|
53
|
-
.
|
|
53
|
+
.fset { /* :not(.fupl-wrapper):not(.form-group) { */
|
|
54
54
|
padding-top: 2rem;
|
|
55
55
|
margin-bottom: .5rem;
|
|
56
56
|
border: none;
|