-
-
Notifications
You must be signed in to change notification settings - Fork 107
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
Enable and fix for dark mode #708
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for numpy-org ready!
To edit notification comments on pull requests, go to your Netlify site configuration. |
@stefanv @jarrodmillman Can't request reviews on this repo, so tagging you. Thanks. |
See https://deploy-preview-708--numpy-org.netlify.app/about/; what do we do with those logos? |
Apologies, I should have checked the other pages as well. I think those logos can be decently handled by filters, like the smaller ones on the tab sections. I'll see what I can do. Marking as a draft until ready for review again. Thanks. |
See #712. |
1d40832
to
11c1c7b
Compare
Looking at the logos again, as Stefan asked. Two options come to mind:
By the way, I noticed that the numpy.org/layouts/shortcodes/sponsors.html Lines 16 to 43 in 3c39fcf
The numpy.org/layouts/shortcodes/partners.html Lines 13 to 40 in 3c39fcf
We should probably replace those with either inline styles on the relevant elements, or generalize them into the page's stylesheet. Please let me know what you'd prefer that I do about them. Thanks. |
Sometimes, images can be used in light and dark mode, but we definitely need the ability to specify different images for each. How about something like this: <img src="img-dark.png" class="dark-theme"/>
<img src="img-light.png" class="light-theme"/> Then, in the stylesheet: html[data-theme="dark"] {
.light-theme {
display: none;
}
}
html[data-theme="light"] {
.dark-theme {
display: none;
}
} |
Re: |
@stefanv Sorry, I'm not sure what you mean about moving |
@Stefan Sure. I think we could also use the picture element to do the same thing without having to add CSS classes. What do you think? |
See <numpy#708 (comment)> and following.
Pushed #725 in re #708 (comment) |
Hm, ok, according to this, it's not officially supported yet, but unofficially it works. I'll close #725 then. Thanks. |
Re: picture element + media selectors:
I considered that, but we do not merely rely on the browser preference, we also allow setting it, and that appears as a data element on html.
|
Thanks. |
Once we get the grid sorted out, maybe these can just be grids of images (i.e., maybe we don't need special roles for sponsors and partners). |
11c1c7b
to
66cfd26
Compare
This reverts commit a856374.
This is a simple way to make them "presentable" in dark mode. Otherwise, we'd need to keep their backgrounds white (which would clash with the dark background), or edit each one individually and swap them for dark mode, which would be more complicated.
This seems to look good, and it avoids the clash of having some bright white, light-mode images when using dark-mode. Since all of these images are illustrations and diagrams, not photographs, it seems good.
Before this change, the images in the div.grid-container were displayed about one line higher than the text in the adjacent paragraph.
66cfd26
to
1a9fe8d
Compare
Let's put this on hold for a bit b/c I want to revisit if we can use theme functionality directly. |
See scientific-python/scientific-python-hugo-theme#599 and #746. Still working on things, but there is progress. |
See #707.
libullet at the top of their contents: c0d23b7