-
Notifications
You must be signed in to change notification settings - Fork 197
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
Define CSS variables when html[data-theme]
does not exist
#1221
Comments
just a note to say that this isn't especially unique to |
pydata-sphinx-theme
is not usedhtml[data-theme]
does not exist
@larsoner thoughts on this? CSS stuff goes over my head. |
Also I wonder if we (scikit-learn) should put efforts into converting to pydata theme, but I am not sure who is well versed in html and has the interest... |
Also I wonder if we (scikit-learn) should put efforts into converting to pydata theme,
We (scikit-learn) should. Chiara Marmo started this work. It is a substantial effort and we should probably create a feature branch from her work and iterate on it.
|
Yes we should for sure. +1 with @GaelVaroquaux thoughts.
I would be interested to have the thing move forward. I assume that the theme should reduce the tricks that we are doing (or we should contribute upstream). I am also far to be know what I am doing with HTML/CSS but we can have a first good-looking enough version and one day, we might get feedbacks/help from UX + frontend developers. |
Yes, and maybe it is enough to have someone good with HTML/CSS to review the work. |
Currently in sphinx-gallery as set of CSS variables (e.g.
sg-background-color
) are defined to handle dark/light modes based on a CSS selector defined bypydata-sphinx-theme
(i.e.data-theme=light/dark
).It makes that
sphinx-gallery
is coupled withpydata-sphinx-theme
and the CSS variable will exist only if the<html>
tag define thedata-theme
selector as show here:https://github.com/scikit-learn/scikit-learn/pull/27659/files#diff-7dc66b1264ca920ea9fd1be8da9eb0d0c1250435d13b83cd69dd14c74e9de59bR12-R14
Somehow, these CSS variables are useful on our hand because it allows to detect the context where we draw the diagram (notebook, IDE, HTML page).
I was wondering if in the context of not using
pydata-sphinx-theme
, these CSS variables could still exist with a default light mode without the need to create the CSS selector frompydata-sphinx-theme
, that could be quite tricky to debug when something goes wrong.NB: I am far to be fluent with the HTML/CSS principles and stacks and I am open to any solution if it appears that we should do differently on sckit-learn side.
The text was updated successfully, but these errors were encountered: