-
Notifications
You must be signed in to change notification settings - Fork 338
Non-legible Xarray HTML representation in dark mode #2189
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
Comments
duplicate of #2020. the heart of the problem is probably pydata-sphinx-theme/src/pydata_sphinx_theme/assets/styles/extensions/_notebooks.scss Lines 42 to 47 in f5c69c8
which in turn calls pydata-sphinx-theme/src/pydata_sphinx_theme/assets/styles/abstracts/_mixins.scss Lines 14 to 23 in f5c69c8
I'd be totally happy doing something a bit more custom for xarray like we do for Pandas DataFrame table output, i.e.: pydata-sphinx-theme/src/pydata_sphinx_theme/assets/styles/abstracts/_mixins.scss Lines 25 to 55 in f5c69c8
The main barrier to getting this done is not having a contributor/maintainer with both the CSS knowledge to write the rules and also sufficient familiarity with xarray to know what all the possible output nodes might be. In other words, I could probably write some CSS that makes the one example in our docs look good, but don't have the time to put together a bunch of test cases for xarray objects of different flavors, compare their If someone from the xarray team can confidently tell us that:
then I think we can reasonably move forward. Without (1), we won't know that what we're doing will generalize, and without (2), we're shooting at a potentially moving target. Side note: probably most of the solution exists in the aforementioned CSS file that gets embedded. We would "just" need to special-case xarray outputs to not get the light background for cell output, and "just" need to translate the embedded CSS rules into our SCSS source (subbing in our own variables where appropriate). |
Sorry I overlooked that one! But thank you very much for the detailed response @drammock
Makes sense. I'm pinging @benbovy here to help answer your specific questions above! I'm hopeful we can identify the way forward and help out. |
Thanks for pinging me @scottyhq. @drammock -- Although I haven't been closely following the changes in the Xarray's repr CSS lately (especially those related to themes), most of the useful information about it can be found at the top of https://github.com/pydata/xarray/blob/main/xarray/static/css/style.css. More specifically:
|
The documentation example for Xarray isn't legible in dark mode:
https://pydata-sphinx-theme.readthedocs.io/en/v0.16.1/examples/pydata.html#Xarray
I see this came up in the past (#739) but I noticed at least in recent versions, the pandas dataframes look great in either mode, but I think the Xarray representation has gotten worse.
I'm new to CSS but am wondering if it would be easy to fix in the theme here by somehow specifying to "only display Xarray cell outputs with light mode styling". Or should the fix really happen in the Xarray code (pydata/xarray#8097)?
I ask because of noticing the changing appearance with different versions of this theme, I believe without changes on the Xarray side. So it does seem like some coordination is necessary. See for example this older version which wasn't ideal, but I'd argue better than the current rendering:
https://pydata-sphinx-theme.readthedocs.io/en/v0.13.3/examples/pydata.html#xarray
Also, we are finally getting around to upgrading the theme to 0.16.1 in the Xarray docs (pydata/xarray#8708), thanks for all the great work here :)
The text was updated successfully, but these errors were encountered: