fix(export): use active theme instead of default for HTML export (#870)

getResolvedThemeColors and getThemeExportColors now fall back to
currentThemeName before getDefaultTheme(), so exports respect the
user's selected theme.
This commit is contained in:
scutifer 2026-01-20 19:20:40 +05:30 committed by GitHub
parent 236285b390
commit a9fbfc7955
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View file

@ -790,7 +790,7 @@ function ansi256ToHex(index: number): string {
* Used by HTML export to generate CSS custom properties.
*/
export function getResolvedThemeColors(themeName?: string): Record<string, string> {
const name = themeName ?? getDefaultTheme();
const name = themeName ?? currentThemeName ?? getDefaultTheme();
const isLight = name === "light";
const themeJson = loadThemeJson(name);
const resolved = resolveThemeColors(themeJson.colors, themeJson.vars);
@ -829,7 +829,7 @@ export function getThemeExportColors(themeName?: string): {
cardBg?: string;
infoBg?: string;
} {
const name = themeName ?? getDefaultTheme();
const name = themeName ?? currentThemeName ?? getDefaultTheme();
try {
const themeJson = loadThemeJson(name);
const exportSection = themeJson.export;