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 { function cssify({ requester }: { requester?: string }): string {
const preamble = `/* customized: ${ const preamble = `/* customized: ${
Object.entries(colors) Object.keys(colors)
.filter(([_, { color }]) => color) .filter((name) => colors[name])
.map(([name, _]) => name)
.join(", ") .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`; } */\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`; vars += `--name-color: var(--name-color-${requester});\n`;
} }
let classes = ""; 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; if (!color) continue;
vars += `--name-color-${name}: ${color};\n`; vars += `--name-color-${name}: ${color};\n`;
classes += classes +=