Skip to content

fix(docs): add custom not-found page with theme-aware styling#5782

Open
sudabg wants to merge 1 commit intocolinhacks:mainfrom
sudabg:fix/404-page-styling
Open

fix(docs): add custom not-found page with theme-aware styling#5782
sudabg wants to merge 1 commit intocolinhacks:mainfrom
sudabg:fix/404-page-styling

Conversation

@sudabg
Copy link

@sudabg sudabg commented Mar 16, 2026

Summary

Fixes #5778 — the 404 page on zod.dev has broken styling in light mode because the default Next.js error page uses a hardcoded black background that ignores the Fumadocs theme.

Changes

  • Add packages/docs/app/not-found.tsx with theme-aware styling using Fumadocs CSS variables

What this fixes

  1. Light mode background — uses var(--color-fd-primary) and var(--color-fd-foreground) instead of hardcoded black
  2. Centered 404 messageflex centering on the content area
  3. Readable text — theme-aware colors work in both light and dark modes
  4. Concise page title — "Page not found" instead of "404: This page could not be found"

The default Next.js 404 page uses a hardcoded black background that
ignores the Fumadocs theme, causing broken visuals in light mode.

Add a custom not-found.tsx that uses CSS theme variables for proper
light/dark mode support, centers the 404 message, and shows a concise
title.

Fixes colinhacks#5778
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docs: 404 page has broken styling in light mode and is not centered

1 participant