Enable and fix for dark mode
See https://github.com/numpy/numpy.org/issues/707.
- [x] Undo https://github.com/numpy/numpy.org/commit/a85637404e6c80d808cd93271b8dbbe346f41761: https://github.com/numpy/numpy.org/pull/708/commits/5dfb7969544515d7f8dd469865d9b53c12077ea5
- [x] Logos not rendering well in dark mode (scientific domains; sponsorships on About):
- https://github.com/numpy/numpy.org/pull/708/commits/bbf3708864445ad22a90b67a085c22ae42650aeb
- https://github.com/numpy/numpy.org/pull/708/commits/b8a2621401c7982e58ffadc9bfb5cfdd6fe4ac25
- https://github.com/numpy/numpy.org/pull/708/commits/ab211a573e0976de3739323666262007eb73778a
- [x] Tabs:
- [x] "Array libraries" tab: logo images need filtering: 6c78d3bef7036bea0b1152d7dfafabec44935343
- [X] "Data Science", "Machine Learning", "Visualization" tabs: colors need fixing: https://github.com/numpy/numpy.org/pull/708/commits/6c78d3bef7036bea0b1152d7dfafabec44935343
- [x] "Visualization" tab's images: https://github.com/numpy/numpy.org/pull/708/commits/5b8a04b4d835045cfbaf86bb449e59d3f45eb54d
- [x] Some tabs have a ~li~ bullet at the top of their contents: https://github.com/numpy/numpy.org/pull/708/commits/c0d23b7e08ab80b0588973793668b6ea6d7ecfa3
- [x] Content top-margin larger for text than images: https://github.com/numpy/numpy.org/pull/708/commits/1d40832e5f7cdab405e67f6b2d63a461479169e6
- [x] Language drop down: wrong color in dark mode (should be fixed in theme?)
- [x] Fixed in https://github.com/scientific-python/scientific-python-hugo-theme/pull/435
Deploy Preview for numpy-org ready!
| Name | Link |
|---|---|
| Latest commit | 1a9fe8d0fad0b9fd24b6bb10084036e20bc33924 |
| Latest deploy log | https://app.netlify.com/sites/numpy-org/deploys/6604408c5c7efc0008195efc |
| Deploy Preview | https://deploy-preview-708--numpy-org.netlify.app |
| Preview on mobile | Toggle QR Code...Use your smartphone camera to open QR code link. |
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?
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.
Looking at the logos again, as Stefan asked.
Two options come to mind:
- For ones with poor contrast, we could use a CSS filter to invert the colors. That would likely fix the contrast, although it would, well, invert the colors. :)
- We could also adjust the background color, or try using a drop-shadow filter, something like that, to gently improve contrast without adjusting the image itself.
By the way, I noticed that the sponsors.html shortcode includes this stylesheet, which isn't functional because it's not in the page header:
https://github.com/numpy/numpy.org/blob/3c39fcfe02f94459e0456180b477ff6760f027d1/layouts/shortcodes/sponsors.html#L16-L43
The partners.html file includes one as well:
https://github.com/numpy/numpy.org/blob/3c39fcfe02f94459e0456180b477ff6760f027d1/layouts/shortcodes/partners.html#L13-L40
We should probably replace those with either inline styles on the relevant elements, or generalize them into the page's stylesheet.
@stefanv @jarrodmillman
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: sponsors.html, it should get its own .css file; or we remove sponsors.html and att it to numpy.org, since I think that's the only place it is being used.
Re:
sponsors.html, it should get its own.cssfile; or we removesponsors.htmland att it tonumpy.org, since I think that's the only place it is being used.
@stefanv Sorry, I'm not sure what you mean about moving sponsors.html to numpy.org.
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:
@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?
Pushed https://github.com/numpy/numpy.org/pull/725 in re https://github.com/numpy/numpy.org/pull/708#issuecomment-1936493405
The style stuff in the shortcodes appears to be functional to me. It appears in the source file and when you remove the styling from the shortcode the page looks different. For example, with the styling
and without it
So we can probably just leave it as is for now. Or move it.
The style stuff in the shortcodes appears to be functional to me. It appears in the source file and when you remove the styling from the shortcode the page looks different. For example, with the styling
and without it
So we can probably just leave it as is for now. Or move it.
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.
I considered that, but we do not merely rely on them 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).
Let's put this on hold for a bit b/c I want to revisit if we can use theme functionality directly.
See https://github.com/scientific-python/scientific-python-hugo-theme/pull/599 and #746. Still working on things, but there is progress.
and without it 