readthedocs / sphinx-hoverxref

Sphinx extension to show tooltips with content embedded when hover a reference.
https://sphinx-hoverxref.readthedocs.io/
MIT License
95 stars 40 forks source link

Prefix all CSS classes with `hxr-` #205

Closed humitos closed 2 years ago

humitos commented 2 years ago

Avoid collisions with other CSS frameworks/themes/etc.

See https://github.com/executablebooks/sphinx-book-theme/issues/577 Closes #180

humitos commented 2 years ago

I opened this PR as an example showing what's the work required to prefix all the CSS classes with hxr-. The only work missing here is to define the prefix somewhere globally and re-use it from a variable or similar, instead of hardcoding it everywhere. In fact, we could make it a extension config if it's required.

humitos commented 2 years ago

Good note! I will probably hit that problem when working on the PR to include jQuery into the extension itself: #204. So, I will try to figure that out altogether. If it's not possible, I will probably remove the ability to change the prefix. At the moment, it's not exposed to users at least, which is good.