mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-08-03 23:42:56 +02:00
Add light mode toggle
This commit is contained in:
@@ -7,6 +7,8 @@ export interface Theme {
|
||||
metaThemeColor: string;
|
||||
}
|
||||
|
||||
export const THEME_CHANGE_EVENT = 'remoteterm-theme-change';
|
||||
|
||||
export const THEMES: Theme[] = [
|
||||
{
|
||||
id: 'original',
|
||||
@@ -77,4 +79,8 @@ export function applyTheme(themeId: string): void {
|
||||
meta.setAttribute('content', theme.metaThemeColor);
|
||||
}
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
window.dispatchEvent(new CustomEvent(THEME_CHANGE_EVENT, { detail: themeId }));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user