1- import { COOKIE_KEY , DARK , LIGHT , MAX_AGE , SYSTEM , modes } from "../../constants" ;
1+ import { COOKIE_KEY , DARK , LIGHT , SYSTEM , modes } from "../../constants" ;
22import { ColorSchemePreference , Store , useStore } from "../../utils" ;
33import { useEffect } from "react" ;
44
@@ -11,11 +11,8 @@ export interface CoreProps {
1111const modifyTransition = ( documentMinify : Document , themeTransition = "none" ) => {
1212 const css = documentMinify . createElement ( "style" ) ;
1313 /** split by ';' to prevent CSS injection */
14- const transition = `transition: ${ themeTransition . split ( ";" ) [ 0 ] } !important;` ;
1514 css . appendChild (
16- documentMinify . createTextNode (
17- `*{-webkit-${ transition } -moz-${ transition } -o-${ transition } -ms-${ transition } ${ transition } }` ,
18- ) ,
15+ documentMinify . createTextNode ( `*{transition:${ themeTransition . split ( ";" ) [ 0 ] } !important;}` ) ,
1916 ) ;
2017 documentMinify . head . appendChild ( css ) ;
2118
@@ -85,7 +82,7 @@ export const Core = ({ t }: CoreProps) => {
8582 // System mode is decided by current system state and need not be stored in localStorage
8683 localStorage . setItem ( COOKIE_KEY , mode ) ;
8784 if ( serverTargetEl )
88- documentMinify . cookie = `${ COOKIE_KEY } =${ resolvedMode } ;max-age=${ MAX_AGE } ;SameSite=Strict;` ;
85+ documentMinify . cookie = `${ COOKIE_KEY } =${ resolvedMode } ;max-age=31536000 ;SameSite=Strict;` ;
8986 } , [ resolvedMode , systemMode , mode ] ) ;
9087
9188 return null ;
0 commit comments