Skip to content

feat(flame): redesign the 404 page with an animated logo mascot - #468

Merged
gitfromwildan merged 2 commits into
mainfrom
feat/flame-404-page
Nov 5, 2026
Merged

gitfromwildan merged 2 commits into
mainfrom
feat/flame-404-page

Conversation

@gitfromwildan

@gitfromwildan gitfromwildan commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Why

The generated 404 page reused the landing page's Hero: a bare "404", "Page not found" and one "Go to Docs" link without an icon. This PR gives it a mascot, a clearer hierarchy and better actions, and keeps the page as light as before.

Changes

packages/flame/.docu/pages/404.tsx (rewritten) and .docu/styles/site.css:

  • Mascot. The project's own navbar.logo from docu.json, so every site's 404 carries its own brand. It is rendered as an <img> and animated with CSS: a float with a slight tilt, a ground shadow that shrinks as it rises, a pulsing halo, and three question marks that rise in turn.
    • Light: the notFound page family ships no script, and the logo is an asset the site already serves and caches.
    • Safe: an SVG loaded through <img> cannot run scripts. Inlining an arbitrary project SVG could, and its ids could collide with the page.
    • Fallback: without a logo, a small inline illustration of a page with a question mark.
  • Motion. Every animation is behind motion-safe:, so visitors who ask for reduced motion see a still page. The keyframes live in site.css, which only the landing and 404 pages load, so the docs CSS does not grow.
  • Text. "404" as the headline, with the theme gradient. "Page not found" as the subheadline. One line of explanation.
  • Actions.
    • "Go to docs" (book icon, primary) and "Back to home" (house icon, outline).
    • Each has a visible label, a 44px minimum touch target and a focus-visible ring. On mobile they stack full width.
    • At a root deployment both would point at /, so a single "Back to home" button is shown.
  • URLs. Every URL stays root-absolute under the deployment path, as before, so the page works at whatever path the host serves it.

configuration.mdx notes in the navbar section that the logo is also the 404 mascot. Patch changeset for @docubook/flame.

Verification

  • Browser (Chromium, flame preview, nested missing path /docs/guide/does/not/exist, flame's own docs with the panda logo):
Variant Status Logo Animation Horizontal scroll Problems
Desktop light 404 loaded running none none
Desktop dark 404 loaded running none none
Pixel 7 light 404 loaded running none none
Pixel 7 dark 404 loaded running none none
Reduced motion 404 loaded animation-name: none none none

"Problems" covers failed requests, uncaught errors and CSP violations.

  • Template builds on Bun and Node:
Case 404 file Mascot Buttons
Template logo /404.html /docs/assets/images/docu.svg /docs/, /
No navbar.logo /404.html inline illustration /docs/, /
Root deployment /404.html /assets/images/docu.svg /
experimental.pages under …/repo /docs/404.html /repo/docs/assets/images/docu.svg /repo/docs/, /repo/

Bun and Node output is identical after normalizing nonces and hashes.

  • The built site-*.css contains the four animate-mascot-* utilities, their keyframes and the prefers-reduced-motion guard.

  • vitest: 795 tests pass. The 9 new tests in not-found-page.test.ts cover:

    • the headline and subheadline;
    • the decorative root-absolute logo and the fallback illustration;
    • motion-safe: on every animation;
    • both buttons with icons, the single root button, deployment-path URLs and an external logo URL.

    tsc, oxlint, prettier and test:release-plan are clean, and the pre-push hook passed.

Review follow-up (da91a4d)

Pullfrog found that the question-mark stagger never applied. The bare [animation-delay:…] utilities were emitted before the motion-safe:animate-mascot-drift rule, whose animation shorthand reset the delay to 0s. Both delays now use the motion-safe: variant. In Chromium the computed delays went from 0s, 0s, 0s to 0s, 1.6s, 3.2s, and reduced motion still stops everything. A test checks the variant.

- Mascot: the project's navbar.logo as an <img>, animated with CSS only
  (float and tilt, a shadow in sync, a pulsing halo, rising question
  marks). The notFound page family ships no script, the logo is an asset
  the site already serves, and an SVG behind <img> cannot run scripts.
  Without a logo, a small inline illustration takes its place.
- Every animation is behind motion-safe:, with keyframes in site.css,
  which only the landing and 404 pages load.
- "404" headline, "Page not found" subheadline, one line of explanation.
- "Go to docs" and "Back to home" with icons, visible labels, 44px touch
  targets and focus rings, stacked full width on mobile. A root
  deployment, where both point at "/", shows a single button.
- URLs stay root-absolute under the deployment path, so the page works
  at any requested path.
- configuration.mdx notes that the logo is the 404 mascot.
@vercel

vercel Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated
docu Ignored Ignored Preview Nov 5, 2026 2:57pm UTC

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ℹ️ No critical issues. One visual bug inline: the question-mark stagger doesn't apply.

Reviewed changes

Initial review (mode: standard) of the redesigned generated 404 page in @docubook/flame. Overall the page is in good shape and ready to merge once the one LOW finding below is fixed. The other two priorities are already met: logo URL resolution matches Navbar/Sidebar, and the motion is gated behind motion-safe:.

  • Mascot from navbar.logo: shown as a decorative <img>, resolved through docsAssetSrc() like the navbar logo. An inline SVG illustration is the fallback.
  • CSS-only motion: four --animate-mascot-* theme animations and keyframes in site.css, which only the notFound and landing page families load. Every animation is gated behind motion-safe:.
  • Actions: "Go to docs" and "Back to home" with lucide icons. At a root deployment, where both targets are /, only one button is shown. All URLs stay under the deployment path.
  • Tests and docs: 8 render tests in not-found-page.test.ts, a note in configuration.mdx, and a patch changeset.

What I checked locally: the new test file, tsc and oxlint are clean. I compiled site.css with the Tailwind CLI, and the motion-safe:animate-mascot-* utilities and keyframes are emitted. Under experimental.pages with FLAME_STANDALONE, "Back to home" goes through the root redirect index.html, so it is not a dead link.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread packages/flame/.docu/pages/404.tsx Resolved
Stagger the rising question marks on the 404 page. The bare
`[animation-delay:…]` utilities were emitted before the
`motion-safe:animate-mascot-drift` rule. Its `animation` shorthand reset
the delay to 0s, so all three marks rose together. With the same
`motion-safe:` variant, Tailwind emits the delays after the shorthand in
the same media block. Computed delays are now 0s, 1.6s and 3.2s.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found. The stagger fix is the right one, and the PR is ready to merge.

Reviewed changes

Incremental review (mode: standard) of da91a4d, which fixes the only finding from the previous review. Verdict: READY.

  • Fixed the question-mark stagger: both delays now use motion-safe:[animation-delay:…], so Tailwind emits them after the motion-safe:animate-mascot-drift shorthand in the same prefers-reduced-motion: no-preference block. Before, that shorthand reset the delay to 0s. This matches the ordering I checked with the Tailwind CLI in the previous run, and reduced motion still stops all animation.
  • Added a regression test: it asserts both motion-safe: delays are present and that no bare [animation-delay: is left. A comment in 404.tsx explains why the variant is needed.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@gitfromwildan
gitfromwildan merged commit 93f725a into main Nov 5, 2026
15 checks passed
@gitfromwildan
gitfromwildan deleted the feat/flame-404-page branch November 5, 2026 15:01
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.

1 participant