Skip to content

Add jupyter-dark-detect for automatic matplotlib dark mode theming#153

Open
brycelelbach wants to merge 1 commit intomainfrom
feature/matplotlib-dark-mode-detect
Open

Add jupyter-dark-detect for automatic matplotlib dark mode theming#153
brycelelbach wants to merge 1 commit intomainfrom
feature/matplotlib-dark-mode-detect

Conversation

@brycelelbach
Copy link
Collaborator

Summary

  • Adds jupyter-dark-detect == 0.1.0 to all 5 tutorial requirements.txt files so matplotlib can detect whether the browser is in dark mode
  • Replaces import matplotlib.pyplot as plt with a 3-line pattern (from jupyter_dark_detect import is_dark / import matplotlib.pyplot as plt / plt.style.use(...)) across all notebooks and helper .py files that import matplotlib
  • Refactors hardcoded color constants in nvmath-python visualization cells (05_device_api, 04_callbacks) and 03__numpy_to_cupy__ndarray_basics__SOLUTION into a COLOR1COLOR6 palette that adapts foreground/accent colors to light vs dark mode

Detects whether the browser is in dark mode via jupyter-dark-detect and
sets the matplotlib style accordingly. Replaces hardcoded color constants
in nvmath-python visualization cells with a COLOR1-COLOR6 palette that
adapts to light/dark mode.
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

❌ Link Check Failed

Broken links were detected in this PR.

Please check the workflow run logs for details on which links are broken.

Common fixes:

  1. Typo in URL - Check for spelling mistakes in the link
  2. Outdated link - The page may have moved or been deleted
  3. Relative path issue - Ensure relative links use the correct path
  4. External site down - If the external site is temporarily down, you can add it to brev/.lycheeignore

To test links locally:

./brev/test-links.bash .

📚 Lychee documentation

@brycelelbach
Copy link
Collaborator Author

Link check/validator broken until #151 is merged.

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