More dark theme styles for visits page

This commit is contained in:
Alejandro Celaya
2021-02-19 20:18:02 +01:00
parent 61af43f9d9
commit d6633f7555
8 changed files with 39 additions and 7 deletions

View File

@@ -2,10 +2,14 @@ export const MAIN_COLOR = '#4696e5';
export const MAIN_COLOR_ALPHA = 'rgba(70, 150, 229, 0.4)';
export const HIGHLIGHTED_COLOR = '#F77F28';
export const HIGHLIGHTED_COLOR = '#f77f28';
export const HIGHLIGHTED_COLOR_ALPHA = 'rgba(247, 127, 40, 0.4)';
export const PRIMARY_LIGHT_COLOR = 'white';
export const PRIMARY_DARK_COLOR = '#161b22';
export type Theme = 'dark' | 'light';
export const changeThemeInMarkup = (theme: Theme) => {
@@ -13,3 +17,9 @@ export const changeThemeInMarkup = (theme: Theme) => {
html?.[0]?.setAttribute('data-theme', theme);
};
export const isDarkThemeEnabled = (): boolean => {
const html = document.getElementsByTagName('html');
return html?.[0]?.getAttribute('data-theme') === 'dark';
};