Created by: barillax
We have a custom extension that sometimes sets the color of containing elements to green (in addition to some other interactive behavior it adds). However, we wanted to be able to defer to overridden colors that were set by the color.js
extension. In pseudocode:
$ x + \mycustomextension[y] $
y
is green as a side effect of \mycustomextension
$ x + \color{red} \mycustomextension[y] $
y
is red due to \color
To accomplish this, we needed color.js
to set a class, mjx-extension-color
on the .mjx-mstyle
element that it creates so that we could adjust our CSS to color: inherit
when .mjx-extension-color
is an ancestor. Without this class, we can't distinguish between overridden colors and overridden sizes, for example.
This PR includes the simple changes to color.js
to accommodate this. I'm open to suggestions for a better class name than mjx-extension-color
.