mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 21:03:19 +00:00
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:
parent
236285b390
commit
a9fbfc7955
2 changed files with 3 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue