Skip to content

Fix notebook text contrast on GitHub Pages#4

Merged
B67687 merged 1 commit intomainfrom
pages/fix-notebook-contrast
Apr 9, 2026
Merged

Fix notebook text contrast on GitHub Pages#4
B67687 merged 1 commit intomainfrom
pages/fix-notebook-contrast

Conversation

@B67687
Copy link
Copy Markdown
Owner

@B67687 B67687 commented Apr 9, 2026

What changed

This PR adds a small CSS override block to each generated notebook HTML page during the Pages build.

Why it changed

The notebook pages are rendering on a light background, but some notebook and ANSI/text output styles can still appear too light, which makes parts of the page hard to read.

User impact

Rendered notebook pages should keep a readable light theme with darker body text, output text, and safer ANSI color handling.

Root cause

The nbconvert/Jupyter CSS bundle brings its own theme variables and output color classes. On the live Pages site, some of those styles were still producing low-contrast text against the white page background.

Validation

I inspected the live notebook HTML at Math-Lessons.html and found Jupyter output/ANSI classes such as .ansi-white-fg, .ansi-white-intense-fg, and inverse foreground styles in the generated page CSS. I then added a post-processing CSS injection in build_pages.py to force a readable light-theme palette for generated notebook pages.

@B67687 B67687 marked this pull request as ready for review April 9, 2026 13:04
@B67687 B67687 merged commit 34e01c3 into main Apr 9, 2026
2 checks passed
@B67687 B67687 deleted the pages/fix-notebook-contrast branch April 9, 2026 13:04
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