10000 feat(inspector): improve merged selector display · unocss/unocss@51df0e7 · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Commit 51df0e7

Browse files
committed
feat(inspector): improve merged selector display
1 parent 9ee61ef commit 51df0e7

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/inspector/client/components/Analyzer.vue

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,19 @@ const mergedSelectors = computed(() => {
5050
}
5151
})
5252
53-
return [...map.values()]
53+
const sorted = [...map.values()]
5454
.sort((a, b) => b.count - a.count)
55+
56+
// Use name without bracket if possible
57+
// `[text-sm] text-sm` -> `text-sm`
58+
sorted.forEach((item) => {
59+
if (item.alias) {
60+
item.name = Object.keys(item.alias)
61+
.sort((a, b) => b.localeCompare(a))[0]
62+
}
63+
})
64+
65+
return sorted
5566
})
5667
5768
const grouped = computed(() => mergedSelectors

0 commit comments

Comments
 (0)
0