Skip to content

fix: unstyled headings stay dark in dark mode - #26

Merged
tdody merged 1 commit into
mainfrom
thibaultdody/fix-dark-mode-default-text-color
Apr 19, 2026
Merged

fix: unstyled headings stay dark in dark mode#26
tdody merged 1 commit into
mainfrom
thibaultdody/fix-dark-mode-default-text-color

Conversation

@tdody

@tdody tdody commented Apr 19, 2026

Copy link
Copy Markdown
Owner

Problem

Reported section headings (Loan Terms, Operating Expenses, Reserves, Professional Fees, Revenue breakdown, Expense breakdown, Tax deductions · non-cash, Sensitivity, Upfront Costs, Revenue, Occupancy, …) remained dark-on-dark in dark mode.

Root cause

No global body text color was ever set in index.css. Tailwind v4's preflight doesn't set one either. Elements without an explicit text-ink class inherited the browser default (black). Most serif section headings — both FormSection titles and ad-hoc <h3>s in the Results / Financing / Revenue & Expenses tabs — didn't carry a text color, so they were invisible on the dark canvas.

Fix

  • @layer base rule in frontend/src/index.css setting html, body { background-color: var(--canvas); color: var(--ink) }. This automatically flips with the .dark class on <html>, fixing every previously-unstyled element in one place.
  • Defensive text-ink on the FormSection title — so the primitive no longer relies on inherited color.

Verification

  • npm run lint — clean
  • npm run build — passes
  • Reported instances now render correctly in dark mode (FormSection titles: Loan Terms / Operating Expenses / Reserves / Professional Fees / Upfront Costs / Revenue / Occupancy; ad-hoc h3s: Revenue breakdown / Expense breakdown / Tax deductions · non-cash / Sensitivity)

🤖 Generated with Claude Code

Cause: no global body text color was set — unstyled elements inherited
the browser default (black), which is invisible on the dark canvas.
Most serif section headings (FormSection titles, ad-hoc <h3>s in
Results / Financing / Revenue & Expenses) didn't carry an explicit
text-ink class, so they appeared dark-on-dark.

Fix
- Add @layer base rule setting html/body background to var(--canvas)
  and text color to var(--ink). This automatically flips with the .dark
  class on <html>, covering every previously-unstyled heading.
- Defensively add text-ink to FormSection's title so the primitive
  doesn't rely on inherited color.

Reported instances now render correctly in dark mode:
- Loan Terms, Operating Expenses, Reserves, Professional Fees,
  Upfront Costs, Revenue, Occupancy (FormSection titles)
- Revenue breakdown, Expense breakdown, Tax deductions · non-cash,
  Sensitivity (ad-hoc h3 in Results / Financing / Revenue & Expenses)

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@tdody
tdody merged commit 80f85d9 into main Apr 19, 2026
2 checks passed
tdody added a commit that referenced this pull request Apr 20, 2026
Phase 2 PRs 1–7 all shipped under THI-45 through THI-54 before this
tracker was committed. Audit on 2026-04-19 confirmed `frontend/src/index.css`
tokens match `README.md` spec exactly (no drift, light + dark). Phase 2
PR 8 (polish pass) is in-progress with #26/#27/#28 landed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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