shlink-web-client/src/utils/theme/index.ts

20 lines
609 B
TypeScript
Raw Normal View History

2020-12-20 12:17:12 +01:00
export const MAIN_COLOR = '#4696e5';
export const MAIN_COLOR_ALPHA = 'rgba(70, 150, 229, 0.4)';
2021-02-19 20:18:02 +01:00
export const HIGHLIGHTED_COLOR = '#f77f28';
2020-12-20 12:17:12 +01:00
export const HIGHLIGHTED_COLOR_ALPHA = 'rgba(247, 127, 40, 0.4)';
2021-02-19 20:18:02 +01:00
export const PRIMARY_LIGHT_COLOR = 'white';
export const PRIMARY_DARK_COLOR = '#161b22';
export type Theme = 'dark' | 'light';
2022-03-06 10:38:26 +01:00
export const changeThemeInMarkup = (theme: Theme) =>
document.getElementsByTagName('html')?.[0]?.setAttribute('data-theme', theme);
2022-03-06 10:38:26 +01:00
export const isDarkThemeEnabled = (): boolean =>
document.getElementsByTagName('html')?.[0]?.getAttribute('data-theme') === 'dark';