Skip to content

Fix MathJax Menu to match current light/dark theme. - #3262

Open
somiaj wants to merge 1 commit into
openwebwork:developfrom
somiaj:mathjax-menu-dark-mode
Open

somiaj wants to merge 1 commit into
openwebwork:developfrom
somiaj:mathjax-menu-dark-mode

Conversation

@somiaj

@somiaj somiaj commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

The MathJax menu does not honor the light/dark setting and is always set based on the browser setting. In addition MathJax does not expose the menu the same way it does other elements. This goes around that and accesses the MathJax Menu directly, and sets the theme based on the setting in the page.

This fix works, unsure how well it does the job, as I don't understand the MathJax internals that well.

@dpvc This also affects the MathJax no-dark-mode.js, and seems MathJax needs to better expose the menu to allow updating its theme to match the chosen one vs the browser.

@dpvc

dpvc commented Oct 28, 2026

Copy link
Copy Markdown
Member

It's true that the no-dark-mode extension doesn't affect the menu, as mentioned in the documentation:

This will prevent dark mode from being used in dialogs and the explorer; menus will remain in dark mode, however

The menu code needs an overhaul, and this (and other issues) can be addressed during that update.

@drgrice1 drgrice1 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that this will work for now. At least until MathJax overhauls its menu code.

Comment thread htdocs/js/MathJaxConfig/bs-color-scheme.js Outdated
The MathJax menu does not honor the light/dark setting and is always
set based on the browser setting. In addition MathJax does not expose
the menu the same way it does other elements. This goes around that
and accesses the MathJax Menu directly, and sets the theme based on
the setting in the page.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@somiaj
somiaj force-pushed the mathjax-menu-dark-mode branch from a1c258c to 23b30a3 Compare October 28, 2026 13:33
@somiaj

somiaj commented Oct 28, 2026

Copy link
Copy Markdown
Contributor Author

@dpvc Thanks, I should learn to find the docs first.

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.

3 participants