11import React from "react" ;
22import { objectKeys } from "tsafe/objectKeys" ;
3- import type { ColorScheme } from "../useIsDark" ;
43import { getAssetUrl } from "../tools/getAssetUrl" ;
54import AppleTouchIcon from "../dsfr/favicon/apple-touch-icon.png" ;
65import FaviconSvg from "../dsfr/favicon/favicon.svg" ;
76import FaviconIco from "../dsfr/favicon/favicon.ico" ;
87import { getScriptToRunAsap } from "../useIsDark/scriptToRunAsap" ;
9- import { fontUrlByFileBasename } from "./fontUrlByFileBasename" ;
8+ import { fontUrlByFileBasename } from "./zz_internal/fontUrlByFileBasename" ;
9+ import { getDefaultColorSchemeServerSide } from "./zz_internal/defaultColorScheme" ;
1010//NOTE: As of now there is no way to enforce ordering in Next Appdir
1111//See: https://github.com/vercel/next.js/issues/16630
1212// @import url(...) doesn't work. Using Sass and @use is our last resort.
1313import "../assets/dsfr_plus_icons.scss" ;
1414
1515export type DsfrHeadProps = {
16- defaultColorScheme : ColorScheme | "system" ;
1716 /** If not provided no fonts are preloaded.
1817 * Preloading of fonts is only enabled in production.
1918 */
@@ -23,7 +22,9 @@ export type DsfrHeadProps = {
2322const isProduction = process . env . NODE_ENV !== "development" ;
2423
2524export function DsfrHead ( props : DsfrHeadProps ) {
26- const { defaultColorScheme, preloadFonts = [ ] } = props ;
25+ const { preloadFonts = [ ] } = props ;
26+
27+ const defaultColorScheme = getDefaultColorSchemeServerSide ( ) ;
2728
2829 return (
2930 < >
0 commit comments