Skip to content

Upgrade MathJax to 4.1.1.#2916

Open
drgrice1 wants to merge 1 commit intoopenwebwork:developfrom
drgrice1:another-mathjax-upgrade
Open

Upgrade MathJax to 4.1.1.#2916
drgrice1 wants to merge 1 commit intoopenwebwork:developfrom
drgrice1:another-mathjax-upgrade

Conversation

@drgrice1
Copy link
Member

The issue with link styles has been fixed, and the workaround in the js/MathJaxConfig/bs-color-scheme.js file removed.

The other issue with the --mjx-bg-alpha versus --mjx-bg1-alpha variable has not been fixed. This should probably be brought to the attention of @dpvc.

The issue with link styles has been fixed, and the workaround in the
`js/MathJaxConfig/bs-color-scheme.js` file removed.

The other issue with the `--mjx-bg-alpha` versus `--mjx-bg1-alpha`
variable has not been fixed.  This should probably be brought to the
attention of @dpvc.
@dpvc
Copy link
Member

dpvc commented Feb 26, 2026

Can you say where the --mjx-bg-alpha issue is discussed? I can' seem to find it.

Note that the definition of --mjx-bg1-color should get replaced when MathJax starts up, and the new value should reference --mjx-bg1-alpha, if you are concerned about its initial value.

@drgrice1
Copy link
Member Author

@dpvc: Sorry, I should perhaps have been more detailed. I don't think that --mjx-bg-alpha is discussed online anywhere. I mentioned it in our developer meeting. I believe that there is a bug in the MathJax code on this. The -mjx-bg-alpha css variable is used in the ts/a11y/explorer/Region.ts file in the https://github.com/mathjax/MathJax-src repository. It defines the --mjx-bg1-color variable as '--mjx-bg1-color': 'rgba(var(--mjx-bg-blue), var(--mjx-bg-alpha))'. However, I don't believe the --mjx-bg-alpha css variable is ever defined anywhere. However, the --mjx-bg1-alpha variable is, and I think that is the variable that was meant to be used in the ts/a11y/explorer/Region.ts file.

However, I may be mistaken. I just know that by adding

	Region[region].style.styles["[data-bs-theme='light']"]['--mjx-bg1-color'] =
		'rgba(var(--mjx-bg-blue), var(--mjx-bg1-alpha))';

to the custom extension it fixes the MathJax explorer background color issue I see.

@dpvc
Copy link
Member

dpvc commented Feb 26, 2026

Yes, that should be --mjx-bg1-alpha, but it should also be replaced via a call to setColor() during the initialization of the menu (unless you have disabled the menu). I will fix it in the next release, but under usual circumstances, the initial value of --mjx-bg1-color will be overwritten.

Are you disabling the MathJax menu?

@drgrice1
Copy link
Member Author

We are not disabling the menu.

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