Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tabs don't switch to dark mode #193

Open
mdorier opened this issue Feb 28, 2024 · 3 comments
Open

Tabs don't switch to dark mode #193

mdorier opened this issue Feb 28, 2024 · 3 comments
Labels

Comments

@mdorier
Copy link

mdorier commented Feb 28, 2024

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

@mdorier mdorier added the bug label Feb 28, 2024
Copy link

welcome bot commented Feb 28, 2024

Thanks for opening your first issue here! Engagement like this is essential for open source projects! 🤗

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! 🎉

@mdorier
Copy link
Author

mdorier commented Feb 29, 2024

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
Copy link
Author

mdorier commented Feb 29, 2024

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):

  • Line 12 of tabs.css, remove color: #1D5C87;
  • Line 29 remove background-color: white;
  • Line 44 remove background: white;

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant