mirror of
https://github.com/harvard-edge/cs249r_book.git
synced 2026-05-09 02:11:56 -05:00
[PR #1515] [MERGED] refactor(sidebar): consolidate to single source of truth (-1508 lines) #9181
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/1515
Author: @profvjreddi
Created: 4/24/2026
Status: ✅ Merged
Merged: 4/24/2026
Merged by: @profvjreddi
Base:
dev← Head:refactor/sidebar-single-source-of-truth📝 Commits (1)
4c33d66refactor(sidebar): consolidate to single source of truth📊 Changes
5 files changed (+23 additions, -1531 deletions)
View changed files
📝
book/quarto/assets/styles/_base-styles.scss(+7 -59)➖
book/quarto/assets/styles/style.scss(+0 -1351)📝
kits/assets/styles/style.scss(+6 -41)📝
labs/assets/styles/style.scss(+5 -40)📝
mlsysim/docs/styles/style.scss(+5 -40)📄 Description
Summary
The follow-up to PR #1514. That PR tightened the shared partial's values; this PR removes the duplicates so there's actually one place to edit going forward.
Before: five places defined
.sidebar-navigation .sidebar-item a— the shared partial + four per-site copies, each keyed off a different accent variable (`$accent`, `$kits-accent`, `$colabs-accent`, `$mlsysim-accent`). Plus a 1350-line orphan `book/quarto/assets/styles/style.scss` that was referenced nowhere and carried yet another copy.After: every site imports the shared partial once. Each site aliases `$accent` to its own site-accent (book via `themes/_theme-harvard`, kits/labs/mlsysim at line 19 of their `style.scss`), so the partial's accent-keyed hover/active states resolve to the right color per site without needing per-site rule copies.
Diff stat
Net −1508 lines, zero behavior change — the partial was already tightened to match these exact values in PR #1514, so removing the duplicates does nothing visible.
Orphan file deletion
`book/quarto/assets/styles/style.scss` was orphaned — the book's builds consume `style-vol1.scss` and `style-vol2.scss` (referenced in `book/quarto/config/_quarto-html-vol1.yml` line 175 and `_quarto-html-vol2.yml` line 178). I checked every `.yml`, `Makefile`, `.sh`, `.py`, `.js`, and `*.scss` file for references to `style.scss` — zero hits. Safe to delete. If something obscure turns up needing it, restore from `git show HEAD^:book/quarto/assets/styles/style.scss`.
Kept per-site
Two site-specific sidebar extras stay in their respective files because they're genuinely site-specific, not duplicated shape:
These are additive — they style different things from the shared rules.
Untouched
Test plan
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.