1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-06-30 01:26:37 -04:00

remove react-spring dependency

This commit is contained in:
2025-03-08 23:13:32 -05:00
parent 6f31bc53c8
commit e166c63988
18 changed files with 200 additions and 512 deletions

View File

@ -76,6 +76,7 @@ export const ThemeProvider = ({ children }: PropsWithChildren) => {
return (
<ThemeContext.Provider value={providerValues}>
<script
id="restore-theme"
// unminified: https://gist.github.com/jakejarvis/79b0ec8506bc843023546d0d29861bf0
dangerouslySetInnerHTML={{
__html: `(()=>{try{const e=document.documentElement,t="undefined"!=typeof Storage?window.localStorage.getItem("theme"):null,a=(t&&"dark"===t)??window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";e.dataset.theme=a,e.style.colorScheme=a}catch(e){}})()`,