[PR #1779] fix(404): support Quarto dark mode toggle on all 404 pages #15730

Open
opened 2026-05-20 14:04:49 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/harvard-edge/cs249r_book/pull/1779
Author: @Shashank-Tripathi-07
Created: 5/18/2026
Status: 🔄 Open

Base: devHead: fix/404-pages-quarto-dark-toggle


📝 Commits (1)

  • a27ff11 fix(404): add body.quarto-dark selectors alongside @media dark rules

📊 Changes

8 files changed (+84 additions, -0 deletions)

View changed files

📝 book/quarto/404.qmd (+10 -0)
📝 instructors/404.qmd (+10 -0)
📝 kits/404.qmd (+14 -0)
📝 labs/404.qmd (+10 -0)
📝 mlsysim/docs/404.qmd (+10 -0)
📝 site/404.qmd (+10 -0)
📝 slides/404.qmd (+10 -0)
📝 tinytorch/quarto/404.qmd (+10 -0)

📄 Description

Problem

All 8 x 404.qmd files style their dark mode content using only @media (prefers-color-scheme: dark). This responds to the OS-level dark preference but does not respond to the Quarto dark mode toggle button, which works by adding body.quarto-dark to the document body instead of setting the OS preference.

This means users who click the toggle button to switch to dark mode see the 404 pages stay in light mode.

Fix

For each of the 8 files, added body.quarto-dark selector blocks immediately after the @media (prefers-color-scheme: dark) block, with identical rules. Both mechanisms now work independently -- OS dark preference still works, and the Quarto toggle button also works.

Files changed

  • book/quarto/404.qmd
  • instructors/404.qmd
  • labs/404.qmd
  • slides/404.qmd
  • tinytorch/quarto/404.qmd
  • kits/404.qmd (includes kits-specific .j404-kits-row rules in the body.quarto-dark block)
  • mlsysim/docs/404.qmd
  • site/404.qmd

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/harvard-edge/cs249r_book/pull/1779 **Author:** [@Shashank-Tripathi-07](https://github.com/Shashank-Tripathi-07) **Created:** 5/18/2026 **Status:** 🔄 Open **Base:** `dev` ← **Head:** `fix/404-pages-quarto-dark-toggle` --- ### 📝 Commits (1) - [`a27ff11`](https://github.com/harvard-edge/cs249r_book/commit/a27ff11fc12dc8a81549b30606955b842452f5d3) fix(404): add body.quarto-dark selectors alongside @media dark rules ### 📊 Changes **8 files changed** (+84 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `book/quarto/404.qmd` (+10 -0) 📝 `instructors/404.qmd` (+10 -0) 📝 `kits/404.qmd` (+14 -0) 📝 `labs/404.qmd` (+10 -0) 📝 `mlsysim/docs/404.qmd` (+10 -0) 📝 `site/404.qmd` (+10 -0) 📝 `slides/404.qmd` (+10 -0) 📝 `tinytorch/quarto/404.qmd` (+10 -0) </details> ### 📄 Description ## Problem All 8 x 404.qmd files style their dark mode content using only `@media (prefers-color-scheme: dark)`. This responds to the OS-level dark preference but does **not** respond to the Quarto dark mode toggle button, which works by adding `body.quarto-dark` to the document body instead of setting the OS preference. This means users who click the toggle button to switch to dark mode see the 404 pages stay in light mode. ## Fix For each of the 8 files, added `body.quarto-dark` selector blocks immediately after the `@media (prefers-color-scheme: dark)` block, with identical rules. Both mechanisms now work independently -- OS dark preference still works, and the Quarto toggle button also works. ## Files changed - `book/quarto/404.qmd` - `instructors/404.qmd` - `labs/404.qmd` - `slides/404.qmd` - `tinytorch/quarto/404.qmd` - `kits/404.qmd` (includes kits-specific `.j404-kits-row` rules in the `body.quarto-dark` block) - `mlsysim/docs/404.qmd` - `site/404.qmd` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-05-20 14:04:49 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/cs249r_book#15730