feat: implement Shiki theme support for VS Code webview and enhance theme handling

This commit is contained in:
Bohdan Triapitsyn
2025-12-15 02:29:39 +02:00
parent 453ac9c706
commit bd25787b92
10 changed files with 467 additions and 23 deletions
+7 -1
View File
@@ -97,7 +97,13 @@ window.addEventListener('message', (event: MessageEvent) => {
}
});
type ThemeChangePayload = 'light' | 'dark' | { kind?: 'light' | 'dark' | 'high-contrast' };
type ThemeChangePayload =
| 'light'
| 'dark'
| {
kind?: 'light' | 'dark' | 'high-contrast';
shikiThemes?: { light?: Record<string, unknown>; dark?: Record<string, unknown> } | null;
};
type ThemeChangeHandler = (theme: ThemeChangePayload) => void;
let themeChangeHandler: ThemeChangeHandler | null = null;