Added components and logic to dynamically change theme

This commit is contained in:
Alejandro Celaya
2021-02-16 19:25:23 +01:00
committed by Alejandro Celaya
parent f313a39b81
commit 9dbf790cc8
10 changed files with 93 additions and 10 deletions

View File

@@ -5,3 +5,11 @@ export const MAIN_COLOR_ALPHA = 'rgba(70, 150, 229, 0.4)';
export const HIGHLIGHTED_COLOR = '#F77F28';
export const HIGHLIGHTED_COLOR_ALPHA = 'rgba(247, 127, 40, 0.4)';
export type Theme = 'dark' | 'light';
export const changeThemeInMarkup = (theme: Theme) => {
const html = document.getElementsByTagName('html');
html?.[0]?.setAttribute('data-theme', theme);
};