name-color sort names

This commit is contained in:
mehbark 2024-07-11 01:21:42 -04:00
parent f28059966e
commit 89d1e122c2

View file

@ -69,9 +69,8 @@ async function update_name_color(name: string) {
function cssify({ requester }: { requester?: string }): string {
const preamble = `/* customized: ${
Object.entries(colors)
.filter(([_, { color }]) => color)
.map(([name, _]) => name)
Object.keys(colors)
.filter((name) => colors[name])
.join(", ")
} */\n/* look, i don't like !important either, but i think it's a better choice than some lame .spec.ific.ity.hack.ing */\n\n`;
@ -80,7 +79,8 @@ function cssify({ requester }: { requester?: string }): string {
vars += `--name-color: var(--name-color-${requester});\n`;
}
let classes = "";
for (const [name, { color }] of Object.entries(colors)) {
for (const name of Object.keys(colors).sort()) {
const { color } = colors[name];
if (!color) continue;
vars += `--name-color-${name}: ${color};\n`;
classes +=