From 60c49f18389ff625177a57277ef8f292a31097bf Mon Sep 17 00:00:00 2001 From: Armand Philippot Date: Sat, 28 Oct 2023 17:12:58 +0200 Subject: refactor(providers,hooks): rewrite PrismThemeProvider & usePrismTheme * reuse Theme provider logic * move DOM mutation from provider to hook * add a script to init theme before page load --- src/utils/constants.ts | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/utils/constants.ts') diff --git a/src/utils/constants.ts b/src/utils/constants.ts index 0c64f3a..7129624 100644 --- a/src/utils/constants.ts +++ b/src/utils/constants.ts @@ -34,5 +34,10 @@ export const ROUTES = { export const STORAGE_KEY = { ACKEE: 'ackee-tracking', MOTION: 'reduced-motion', + PRISM: 'prismjs-color-scheme', THEME: 'theme', } as const; + +export const PRISM_THEME_ATTRIBUTE = 'data-prismjs-color-scheme-current'; + +export const VALID_THEMES = ['dark', 'light', 'system'] as const; -- cgit v1.2.3