client: Improve group for no theme

This commit is contained in:
Elian Doran
2024-10-31 21:17:40 +02:00
parent cc0b3db424
commit a690155d7e
4 changed files with 21 additions and 13 deletions

View File

@@ -10,15 +10,16 @@ interface ColorTheme {
export function listSyntaxHighlightingThemes() {
const path = "node_modules/@highlightjs/cdn-assets/styles";
const systemThemes = readThemesFromFileSystem(path);
const allThemes = [
{
val: "none",
title: t("code_block.theme_none")
},
...systemThemes
];
return groupThemesByLightOrDark(allThemes);
return {
"": [
{
val: "none",
title: t("code_block.theme_none")
}
],
...groupThemesByLightOrDark(systemThemes)
}
}
function readThemesFromFileSystem(path: string): ColorTheme[] {