@@ -6,7 +6,6 @@ import type { AppProps, AppContext } from "next/app";
66import type { DocumentProps , DocumentContext } from "next/document" ;
77import { startReactDsfrNext } from "./lib/start" ;
88import {
9- getClientSideIsDark ,
109 rootColorSchemeStyleTagId ,
1110 SsrIsDarkProvider ,
1211 data_fr_scheme ,
@@ -145,8 +144,7 @@ export function createNextDsfrIntegrationApi(params: Params): NextDsfrIntegratio
145144 ...props
146145 } : AppProps & Record < typeof isDarkPropKey , boolean | undefined > ) {
147146 if ( isDark === undefined ) {
148- //NOTE: No cookie and default "system" or client side
149- isDark = isBrowser ? getClientSideIsDark ( ) : false ;
147+ isDark = isBrowser ? /*we do not use it*/ ( null as any as boolean ) : false ;
150148 }
151149
152150 useEffect ( ( ) => {
@@ -182,13 +180,19 @@ export function createNextDsfrIntegrationApi(params: Params): NextDsfrIntegratio
182180 href = { faviconWebmanifestUrl }
183181 crossOrigin = "use-credentials"
184182 />
185- < style id = { rootColorSchemeStyleTagId } > { `:root { color-scheme: ${
186- isDark ? "dark" : "light"
187- } ; }`} </ style >
188- < meta
189- name = "theme-color"
190- content = { getColors ( isDark ) . decisions . background . default . grey . default }
191- > </ meta >
183+ { ! isBrowser && ( //NOTE: On browser we handle this manually
184+ < >
185+ < style id = { rootColorSchemeStyleTagId } > { `:root { color-scheme: ${
186+ isDark ? "dark" : "light"
187+ } ; }`} </ style >
188+ < meta
189+ name = "theme-color"
190+ content = {
191+ getColors ( isDark ) . decisions . background . default . grey . default
192+ }
193+ />
194+ </ >
195+ ) }
192196 </ Head >
193197 { isBrowser ? (
194198 < App { ...( props as any ) } />
0 commit comments