We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0ca6e73 commit 6b5d2a4Copy full SHA for 6b5d2a4
1 file changed
src/utils/index.ts
@@ -89,7 +89,8 @@ export function sortClassNames(classNames: string, variantsMap: {[key:string]: n
89
const head = variants.join(':') + ':';
90
const utility = raw.replace(head, '');
91
const key = utility.match(/\w+/);
92
- const offset = variants.map(i => variantsMap[i] * 100).reduce((p, c) => p + c, 0) + (important ? 500: 0);
+ const hasDynamicValue = utility.match(/\d+/);
93
+ const offset = variants.map(i => variantsMap[i] * 100).reduce((p, c) => p + c, 0) + (important ? 500: 0) + (hasDynamicValue ? 25 : 0);
94
if (key === null) return { raw, weight: offset };
95
return { raw, weight: (keyOrder[key[0]] ?? 300 ) + offset };
96
}).sort((a, b) => a.weight - b.weight).map(i => i.raw).join(' ');
0 commit comments