Skip to content

fix(theme): dark/light readability + alignment fixes across lessons and interview banks#35

Merged
dineshbyte merged 3 commits into
developfrom
fix/lesson-heading-align-interview-qa-divider
Jun 22, 2026
Merged

fix(theme): dark/light readability + alignment fixes across lessons and interview banks#35
dineshbyte merged 3 commits into
developfrom
fix/lesson-heading-align-interview-qa-divider

Conversation

@dineshbyte

Copy link
Copy Markdown
Owner

What & why

Four DRY theme/alignment fixes, each applied in one place so the pattern is
corrected everywhere it appears.

  1. .lvltop badge alignment (lesson.css) — the default h2 margin isn't
    collapsed inside the align-items:center flex row, so the heading text sat
    ~0.95rem below the numbered badge. Zero the heading margin inside .lvltop.
  2. Interview Q↔A divider (lesson.css) — open details.iq summary and answer
    were the same colour with no gap, fusing in dark mode. Add a theme-aware
    var(--line) divider under the open summary.
  3. Myth/truth cards (lesson.css) — the shared .myth pattern only tinted the
    background, too faint in dark mode. Add the semantic left border
    (var(--bad) / var(--good)) to match the per-lesson variant.
  4. REST interview banks unreadable in dark mode (InterviewLayout.astro) — the
    Q&A panel was pinned to cream paper but --ink wasn't, so dark-mode text went
    light-on-cream (invisible). Card bg now follows --card; a
    html[data-theme="dark"] [data-interview] override maps the panel onto the dark
    surface tokens. Light/default keeps the cream Tufte look exactly.

Checklist

  • pnpm build — 98 pages, green
  • node scripts/validate-content.cjs — all content checks passed
  • node scripts/check-broken-links.cjs — no broken internal links

Two notes before you merge:

  • I couldn't see rendered pixels — worth a dark-mode glance at a lesson (.lvltop + myth cards) and a REST interview bank on the deploy preview.
  • This merges into develop; it won't go live until a separate develop → main release PR (deploy is main-only).

…om A

Two DRY fixes in public/assets/lesson.css that reach every lesson and
interview page from one place:

1. .lvltop numbered section header — the badge and <h2> share a flex row
   (align-items:center), but the default h2 margin (2.4rem/.5rem) is not
   collapsed inside a flex item, so centering pivots on the margin-box and
   the heading text dropped ~0.95rem below the badge. Zero the heading
   margin inside .lvltop so it centers on the badge.

2. Interview <details class="iq"> — the bold summary (question) and the
   .a div (answer) were both --ink with no gap, so in dark mode the two
   fused. Add a theme-aware var(--line) divider under the open summary so
   question and answer read distinctly in both themes.
The shared .myth pattern (used by most lessons) only tinted the card
background, with plain --ink text. In dark mode that tint is too faint to
signal bad-vs-good, so myth and truth cards read identically. The
per-lesson _0005/_0003 variant already adds a colored left border; bring
the shared rule up to match — .myth .m gets var(--bad), .myth .t gets
var(--good) — so the distinction is scannable in both themes. Scoped to
.myth so the .miscon callout is unaffected.
The Tufte interview layout pinned the Q&A panel to cream paper
(--card:#fcfbf2 plus a hardcoded background:#fcfbf2) for its light look,
but never pinned --ink. In dark mode the global theme flips --ink light,
so the card text rendered light-on-cream — effectively invisible (the
questions and answers were unreadable).

Fix in src/layouts/InterviewLayout.astro (one place, every bank):
- card background now follows the --card token instead of hardcoded cream
- add `html[data-theme="dark"] [data-interview]` override mapping the
  panel onto the dark surface tokens (--surface / --bg-soft /
  --surface-elevated / --text-muted), so dark mode gives dark cards with
  light text — consistent with the lesson interview cards.
- --ink stays unpinned so card text follows the theme.

Light/default keeps the exact cream Tufte paper look.
@dineshbyte dineshbyte merged commit 3edf592 into develop Jun 22, 2026
@dineshbyte dineshbyte deleted the fix/lesson-heading-align-interview-qa-divider branch June 22, 2026 20:31
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