sphinx-extensions2 / sphinx-tippy

Get rich tool tips in your sphinx documentation!
https://sphinx-tippy.readthedocs.io
MIT License
33 stars 5 forks source link

Can we tweak the background color of the tooltips #12

Open pique-b opened 8 months ago

pique-b commented 8 months ago

I have been trying to adapt sphinx-hoverxref in my documnetation project, however not being able to test it in local system was quite limiting. Found the sphinx-tippy extension from a link to my question about the issue.

So far as basic tooltips are concerned, tippy seems to work. I was wondering if we can change the background color from the default (which comes out as black presently) to something lighter, preferably white. With a dark background some of the texts in the tip are obscured.

Check this image:

example_tip

Can you suggest a way around to do so in the present scheme of things?

If I may, there is another query:

The wikipedia tips are quite nice. However, I was wondering if we may do a similar thing with other sources, say an imdb page?

ValMystletainn commented 7 months ago

You can do it by custom the css by yourself. see the guid given by the author in the important block

This package just add the javascript code from tippy.js, and the default theme provided by tippy.js is dark theme. Now the author not setting the theme in his/her invoking js code. So another solution is add a python readable config option named "theme", and pass it to the javascript code