diff --git a/package.json b/package.json index cc84311..8b8ae3a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,11 @@ { "name": "tanstack-start-example-basic-react-query", "private": true, - "sideEffects": false, + "sideEffects": [ + "**/*.css", + "**/themes/styles.ts", + "**/themes/theme-styles.ts" + ], "type": "module", "scripts": { "dev": "vite dev --host 0.0.0.0", diff --git a/src/app/routes/__root.tsx b/src/app/routes/__root.tsx index 217155c..b9eb8f0 100644 --- a/src/app/routes/__root.tsx +++ b/src/app/routes/__root.tsx @@ -203,7 +203,17 @@ function RootDocument({ children }: { children: React.ReactNode }) { media="(prefers-color-scheme: dark)" content={CHROME_COLORS.dark.base} /> - + + {/* Pre-hydration theme restore from ThemeProvider's localStorage + mirrors: data-theme (so exotic themes don't flash default), + forced color scheme (dark-only themes must not paint light), + and the theme's font stylesheets (avoid FOUT until hydration). */} +