Skip to content

Commit 3d5da0d

Browse files
committed
Attempt to debug AppDir
1 parent 2a129c9 commit 3d5da0d

File tree

2 files changed

+4
-29
lines changed

2 files changed

+4
-29
lines changed

src/next-appdir/DsfrHead.tsx

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ import spectralExtraBoldWoff2Url from "../dsfr/fonts/Spectral-ExtraBold.woff2";
1818
import AppleTouchIcon from "../dsfr/favicon/apple-touch-icon.png";
1919
import FaviconSvg from "../dsfr/favicon/favicon.svg";
2020
import FaviconIco from "../dsfr/favicon/favicon.ico";
21-
import { data_fr_scheme, data_fr_theme, rootColorSchemeStyleTagId } from "../useIsDark/constants";
22-
import { getColors } from "../fr/colors";
21+
import { data_fr_scheme, data_fr_theme } from "../useIsDark/constants";
2322
import "../dsfr/dsfr.css";
2423
import "../dsfr/utility/icons/icons.css";
2524

@@ -129,33 +128,6 @@ export function DsfrHead(props: DsfrHeadProps) {
129128
130129
["${data_fr_scheme}", "${data_fr_theme}"].forEach(attr => document.documentElement.setAttribute(attr, isDark ? "dark" : "light"));
131130
132-
{
133-
134-
const element = document.createElement("style");
135-
136-
element.id = "${rootColorSchemeStyleTagId}";
137-
138-
element.innerHTML = \`:root { color-scheme: \${isDark ? "dark" : "light"}; }\`;
139-
140-
document.head.appendChild(element);
141-
142-
}
143-
144-
{
145-
146-
const element = document.createElement("meta");
147-
148-
element.name = "theme-color";
149-
150-
element.content = isDark ? "${
151-
getColors(true).decisions.background.default.grey.default
152-
}" : "${
153-
getColors(false).decisions.background.default.grey.default
154-
}";
155-
156-
document.head.appendChild(element);
157-
158-
}
159131
`
160132
}}
161133
></script>

src/next-appdir/start.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ export function dsfrEffect(): void {
5454
if (isAfterFirstEffect) {
5555
return;
5656
}
57+
58+
console.log("hydration now!");
59+
5760
isAfterFirstEffect = true;
5861
actions.forEach(action => action());
5962
}

0 commit comments

Comments
 (0)