1 import { existsSync } from "fs";
2 import { readdir } from "fs/promises";
4 const extraThemesFolder =
5 process.env["LEMMY_UI_EXTRA_THEMES_FOLDER"] || "./extra_themes";
16 export async function buildThemeList(): Promise<string[]> {
17 if (existsSync(extraThemesFolder)) {
18 const dirThemes = await readdir(extraThemesFolder);
19 const cssThemes = dirThemes
20 .filter(d => d.endsWith(".css"))
21 .map(d => d.replace(".css", ""));
22 themes.push(...cssThemes);