mirror of
https://github.com/NohamR/gitprofile.git
synced 2026-05-25 04:17:13 +00:00
Change theme
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
import config from "../config";
|
||||
|
||||
export const getThemeValue = () => {
|
||||
if (localStorage.hasOwnProperty('theme')) {
|
||||
let theme = localStorage.getItem('theme');
|
||||
return theme;
|
||||
}
|
||||
|
||||
return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : config.defaultTheme;
|
||||
}
|
||||
Reference in New Issue
Block a user