Skip to content

Conversation

@dpvc
Copy link
Member

@dpvc dpvc commented Jan 23, 2026

This PR creates a new ui/no-dark-mode component that removes the dark-mode colors for MathJax (other than for the menu, which doesn't hook into the MathJax._ variable, and so doesn't have a reasonable way to alter the styles).

There are a number of files that set up dark-mode colors, and they are in various different extensions. This component works by first checking if the extension is already loaded, and modifying the needed styles if so, otherwise it sets up a loader configuration parameter for code that runs when the extension loads, and removes the styles at that point. The data needed to do this is stored in an array (giving the MathJax._ location to check for the extension being loaded, the name of the extension if not, and the code to run to remove the styles). The explorer adjustment also hooks into the startup handler processing in order to remove some styles, since they are in a mixing that can't be adjusted directly.

This component only works within the MathJax Components framework, so can't be used with direct module access (as the MathJax._ variable is not available there). If support for this in server-side processing is needed, we can address that as the need arrises.

Resolves issue mathjax/MathJax#3502.

@dpvc dpvc requested a review from zorkow January 23, 2026 18:58
@dpvc dpvc added this to the v4.1.1 milestone Jan 23, 2026
@codecov
Copy link

codecov bot commented Jan 23, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 86.51%. Comparing base (95faa0c) to head (60d2484).

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1422   +/-   ##
========================================
  Coverage    86.51%   86.51%           
========================================
  Files          340      340           
  Lines        85993    85994    +1     
  Branches      4825     4825           
========================================
+ Hits         74397    74398    +1     
+ Misses       11596    11573   -23     
- Partials         0       23   +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants