-
Notifications
You must be signed in to change notification settings - Fork 29.6k
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
doc: add dark mode styles #36306
doc: add dark mode styles #36306
Conversation
Pulled colors from nodejs.dev Refs: nodejs#35793
doc/api_assets/style.css
Outdated
@@ -716,3 +716,19 @@ kbd { | |||
overflow: hidden; | |||
} | |||
} | |||
@media (prefers-color-scheme: dark) { | |||
body { | |||
background-color: #090c15; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove the trailing whitespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sure thing, 2 minutes
doc/api_assets/style.css
Outdated
color: #cbd4d9; | ||
} | ||
a:link { | ||
color: #5fa04e; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also the trailing whitespace here.
doc/api_assets/style.css
Outdated
color: #5fa04e; | ||
} | ||
#column2.interior, #column2 ul { | ||
background-color: #0d111d; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...and here as well.
Are the different background colors between the nav pane on the left and the main display area intentional? They're similar...but not quite the same. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this! The color contrast issue is definitely something we'd want fixed before landing but all my other comments are things that can be ignored for now as minor.
@nodejs/website If we do this for the docs, I imagine we'd want to do it for the rest of the site as well? So I imagine you'll have some thoughts.... |
Needs to handle borders, dividers, etc. Essentially dark mode should remap every color. I suggest using CSS variables instead of hardcoding colors which among maintenance benefits also allows easier third-party theming. Also, that shade of blue seems rather opinionated to me. suggest a neutral dark gray like Also, I do think we need it toggleable via JS, not just via |
They are; I mimicked https://nodejs.dev as requested in the original ticket. If we want to use different values though, I'm open to suggestions. |
For the borders/dividers, the existing values for borders (usually lighter shades), meshed well with the values from https://nodejs.dev. As far as using CSS variables go, nothing else in either stylesheet for this set of pages is using CSS variables, so it seemed reasonable to me to match the existing patterns instead of refactoring the entire stylesheet, or only using variables for the darkmode theme.
I pulled all color values from https://nodejs.dev; I've got no preferences for these, if we want to change the values I'm open to suggestions.
I'm amenable to this, I can push another commit to this PR this evening, EST, if its a blocking concern. |
One example of a border that will not work is the Regarding variables: I think it's reasonable to do now. This indirection for colors was not necessary before but is now with two themes. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a very good start! Something that I would be interested in seeing is having a way to toggle between the two modes. If that's not included in this PR, it can surely come later, though.
Yeah, I intended to add a toggle yesterday evening but my day job ended up running a bit long, will try to add something in today. |
@jabyrd3 do you still want to work on this? You'd need to rebase the PR to resolve the git conflict. Also, it'd be nice to use the |
This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open. |
Closing this because it has stalled. Feel free to reopen if this PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions. |
Pulled colors from nodejs.dev
Refs: #35793
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes