diff --git a/serverside/name-color.ts b/serverside/name-color.ts index 9e21836..8374b96 100644 --- a/serverside/name-color.ts +++ b/serverside/name-color.ts @@ -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 +=