mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-21 21:43:04 -05:00
[PR #1779] fix(404): support Quarto dark mode toggle on all 404 pages #15730
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 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:
dev← Head:fix/404-pages-quarto-dark-toggle📝 Commits (1)
a27ff11fix(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 addingbody.quarto-darkto 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-darkselector 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.qmdinstructors/404.qmdlabs/404.qmdslides/404.qmdtinytorch/quarto/404.qmdkits/404.qmd(includes kits-specific.j404-kits-rowrules in thebody.quarto-darkblock)mlsysim/docs/404.qmdsite/404.qmd🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.