executablebooks / sphinx-tabs

Tabbed views for Sphinx
https://sphinx-tabs.readthedocs.io
MIT License
263 stars 67 forks source link

Tabs don't switch to dark mode #193

Open mdorier opened 5 months ago

mdorier commented 5 months ago

Describe the bug

I am using the sphinx_book_theme and I enabled the light/dark button. I am using group_tabs to show multiple codes as follows:

  .. tabs::

     .. group-tab:: C++

        .. literalinclude:: ../_code/energy_topic.cpp
           :language: cpp
           :start-after: START CREATE TOPIC
           :end-before: END CREATE TOPIC
           :dedent: 8

     .. group-tab:: Python

        Work in progress...

     .. group-tab:: mofkactl

        Work in progress...

With the light mode this is what is shown:

Screenshot 2024-02-28 at 10 08 58

With dark mode, this is what I have:

Screenshot 2024-02-28 at 10 09 11

The code itself switched to its dark theme, however the tab around it and the tabs' titles stay on light mode.

expectation

I would expect the tabs to also switch to a dark theme.

Reproduce the bug

Example of site reproducing the problem: https://mofka.readthedocs.io/en/latest/usage/topics.html#creating-a-topic The source is here: https://github.com/mochi-hpc/mofka/tree/b440d2ed2b2cea788044718c76890d647f50b1a1/docs

List your environment

No response

welcome[bot] commented 5 months ago

Thanks for opening your first issue here! Engagement like this is essential for open source projects! :hugs:
If you haven't done so already, check out EBP's Code of Conduct. Also, please try to follow the issue template as it helps other community members to contribute more effectively.
If your issue is a feature request, others may react to it, to raise its prominence (see Feature Voting).
Welcome to the EBP community! :tada:

mdorier commented 4 months ago

In the above images at least the code shows up in dark mode, but when I add text, the text has the dark-mode color, on top of a light-mode background, making it unreadable:

Screenshot 2024-02-29 at 09 31 11
mdorier commented 4 months ago

Potential fix (I don't know much about CSS, this is from playing around in developer mode on Firefox, disabling some properties of the CSS):

These lines seem to force colors that are not theme-dependent.