Setting background colour for hoverbox extra


Is there a way to explicitly set background colour for the portion of hover box?

I have a situation in which the automatically generated style is not readable.

I fixed this by overriding css in dash.

In my assets/custom.css, I included:

.plotly .hoverlayer .hovertext rect {
  fill-opacity: 1 !important;

.plotly .hoverlayer .hovertext text {
  fill: black !important;

If anyone knows about a cleaner solution, Iā€™m happy to learn!