Update compiler.ts

This commit is contained in:
thororen 2024-07-14 14:47:03 -04:00 committed by GitHub
parent cf889331e7
commit f349b19a31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,7 +18,7 @@ const preprocessors: { [preprocessor: string]: (text: string, vars: Record<strin
.map(([name, value]) => `--${name}: ${value}`) .map(([name, value]) => `--${name}: ${value}`)
.join("; "); .join("; ");
return `/* ==Vencord== */\n:root{${variables}}\n/* ==/Vencord== */${text}`; return `/* ==Equicord== */\n:root{${variables}}\n/* ==/Equicord== */${text}`;
}, },
async uso(text: string, vars: Record<string, string>) { async uso(text: string, vars: Record<string, string>) {
@ -55,7 +55,11 @@ const preprocessors: { [preprocessor: string]: (text: string, vars: Record<strin
}; };
export async function compileUsercss(fileName: string) { export async function compileUsercss(fileName: string) {
const themeData = await VencordNative.themes.getThemeData(fileName); try {
var themeData = await VencordNative.themes.getThemeData(fileName);
} catch (e) {
UserCSSLogger.warn("Failed to get theme data for", fileName, "(has it gone missing?)", e);
}
if (!themeData) return null; if (!themeData) return null;
// UserCSS preprocessor order look like this: // UserCSS preprocessor order look like this: