colors for hovertext in light and dark mode #556
+10
−3
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
related to: #539
fixes: #532
sorry i couldn't help with this during the sprint - i puzzled over this for quite awhile in the initial implementation, i was just afk during those hours.
the basic problem is that plotly has a pretty messy way of handling styles. there isn't really a uniform way of passing style information through a complex plot object, and in particular it seems to accept full css expressions in some places, plotly-specific values other places - and probably most confusing, an undocumented subset of css in a third set of places.
font color seems to be one of those third places, where if you pass an
rgb(x,y,z)
string there, it works, but everything else is silently ignored (programming lesson for any newbies that may see this! fail loudly!) So while we're passing valid CSS through in the layout call, it silently strips it out, so thosevar(--bs-body-color)
are just dropped and do nothing.second layer of the problem is that plotly then injects its own inline CSS for all the generated svg objects. in css, styles that are applied directly on an element have the highest priority, so there isn't a way for us you override them except to use the accursed
!important
flag (and i couldn't find a way to tell plotly to just not inject styles.@lwasser finding the correct class for the hover text is challenging here compared to a "normal" hover effect because it's not a css hover effect, but a JS-based one where the DOM element ceases to exist once you stop hovering. the only way i found to actually figure out what selector to use there is a sort of hack, where i hovered, right clicked, inspect element, and then positioned the element inspector underneath where my mouse would be on a prior opening so that the plotly JS wouldn't detect my mouse having moved (and thus remove the hover DOM element). super janky.
i sorta think at this point that just manually templating SVG would be easier than using plotly, but here we are.