-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
added: a dark mode in css for us night dwellers #515
Conversation
In the past I've resisted adding dark mode support because I wasn't a fan of any complexity, but I'm coming around to it, if we do it only in CSS as in this PR. I think we should iterate on the exact styling:
If you're up to iterate on the styling per above please give it a shot. I also welcome any other observers to jump in with their own style suggestions. I can't finalize the style myself right away but I can plan to get to it before too long, in the next week or so. The CSS file also needs some minor style and consistency tweaks but I'm happy to do that at the end. Old issues for reference:
|
Just a quick note that we use the Go package https://github.com/alecthomas/chroma for syntax highlighting now. It seems to have a style gallery here: https://xyproto.github.io/splash/docs/longer/all.html with at least the Of course we can customize it at will, I just wanted to make sure we don't get confused by pygments names in case things have deviated |
great feedback I can work on this change tonight. |
Refactoring: * Refactor CSS to make clear what varies with light/dark mode and what doesn't. * Consistently use 2 spaces for indenting in CSS file. * Remove unused Chroma CSS classes to make styling easier to understand. * Add some comments about how Chroma CSS classes map to Go code. * Organize Chroma CSS classes so that like-styled classes are contiguous. * Display "operators" like regular code - doesn't make sense to style ":=" specially but not "=" e.g. Style tweaks: * Adjust dark mode styling to be less blue, more subdued.
Thank you @ChrisMcKenzie! I've built on your PR by further refactoring the code to make it easier for us to reason about light vs dark mode here and in the future. I've also done some further style experiments (see below). I'd like to let this bake in PR for a bit to see if others have comments on the styling or anything else. I may also want to try more styling variations but this is all I can do today. IMO it's looking promising though! |
@ChrisMcKenzie's second version looks better to me. |
After thinking about it some more, I'm going to go ahead merge the iterated design I had with a few more tweaks. We probably just all have our slightly different preferences, but fwiw what I'm trying to go for here a) a straight-greyscale background (vs blue or purple tinted) and subdued foreground colors (vs. too bright or neon), as we have in the light style. (Note that the screenshot may look unusually weird to you on GitHub if you have that on dark mode, because of the blue/purple tint on GitHub.) Anyways part of this change makes it a lot easier for us to change syntax highlighting styles in the future, which I'll be open to doing (for both light and dark mode). Hopefully folks with dark mode enabled on their systems at least find this better than bright white 😎 |
This site has been a part of my reference site list for a long time but for me a dark theme user it gets a bit fatiguing so it would be nice to have a simple dark mode. hope it isn't offensive just thought it would be a nice addition.
the colors are based on tokyo_night