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

HTML repr dark/light themes in Sphinx Furo #6500

Closed
kmpaul opened this issue Apr 18, 2022 · 1 comment · Fixed by #6501
Closed

HTML repr dark/light themes in Sphinx Furo #6500

kmpaul opened this issue Apr 18, 2022 · 1 comment · Fixed by #6501

Comments

@kmpaul
Copy link
Contributor

kmpaul commented Apr 18, 2022

What is your issue?

The Xarray HTML repr assumes that light vs dark theming is stored in the html element's theme attribute (i.e., <html theme="dark"> or <html theme="light">).

However, the Sphinx Furo theme assumes that light vs dark theming is stored in the body element's data-theme attribute. As a result, if you use the Sphinx Furo theme for documentation and use Xarray HTML reprs, the Xarray HTML reprs do not display properly.

In truth, it seems that this comes down to the light vs dark theming not being standardized, which presents a problem of how to support multiple (possibly innumerable) different ways of specifying light or dark themes. That said, the Sphinx Furo theme has growing popularity, and I wonder if it could be supported as a special case (as is vscode dark themes).

To do this, one would need only modify one line of xarray/static/css/style.css:

html[theme=dark],
body.vscode-dark {

to:

html[theme=dark],
body[data-theme=dark],
body.vscode-dark {

If this is something that the Xarray community would support, I'm happy to put together a PR to do this.

@kmpaul kmpaul added the needs triage Issue that has not been reviewed by xarray team member label Apr 18, 2022
@dcherian dcherian added topic-html-repr and removed needs triage Issue that has not been reviewed by xarray team member labels Apr 18, 2022
@dcherian
Copy link
Contributor

Sounds OK to me!

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

Successfully merging a pull request may close this issue.

2 participants