-
Notifications
You must be signed in to change notification settings - Fork 118
Add Dark Mode Feature to thecodingtrain Website #1504
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
Comments
Hi @Yashasewi thank you for this! This is widely requested and would be wonderful to integrate. @runemadsen this affects the design quite significantly, would you mind offering any feedback or thoughts before we proceed with any implementation? |
This will be very cool! I would just make sure that the softness coming from the light grays are transferred to the dark mode layout by using blacks that are not fully black. I would make sure to use CSS variables so this is easy to tweak, and I'll be happy to take a look once the initial PR is in :) |
Thank you @runemadsen! It occurred to me that @jasontheillustrator might also want to take a look as dark mode may affect the illustrations and logos on the site as well. Thank you again @Yashasewi! |
Ah sorry, I completely missed the previews 😬 I think this is looking really good! I would consider making the darks a bit lighter. It doesn't have to be much (perhaps closer to what we do on our site so it doesn't come off as contrasted. I think we should find a way to keep the soft red lines on the background, but we can take all of that once there's a PR to check. |
Hi everyone! |
Hi everyone, Before proceeding with the pull request, I'd like to discuss the approach I've taken for implementing the dark mode feature. Implementation Approach: filter: invert(100%) hue-rotate(180deg); This approach was inspired by the blog post Implementing dark mode in a handful of lines of CSS with CSS filters. Advantages:
Potential Drawbacks:
Implementation Details:
Updated preview 👇👇 Next Steps: I'm open to suggestions and willing to explore alternative implementations if deemed more suitable. Please let me know your thoughts, and I'll be happy to address any concerns or make adjustments as needed. Thank you for your valuable input and collaboration! |
Thanks for this description @Yashasewi. It's super helpful to understand the approach. Having thought about it for a bit, I would highly recommend to not do the dark mode with CSS filters, as all the brand colors will have random opposites applied without us being able to select those colors. I think a better solution would be to apply a theming class to the body and override the CSS variables that we're already using throughout the site. It won't be much more work, and it would allow us to pick the individual colors, which is much preferred compared to just inverting the entire color scheme. |
Thank you, @runemadsen, for your valuable feedback and suggestion. I appreciate you taking the time to review the CSS filter approach and providing your insights. Based on your recommendation, I have implemented the dark mode feature using CSS variables and theming classes. This approach allows for better control over individual colors and ensures that the branding and design elements retain their intended appearance. Remaining Issues: While implementing the dark mode with CSS variables, I encountered a few instances where colors were hard-coded instead of using variables. I have identified and updated most of these instances, but there may still be some areas that need further attention. If you or the team members notice any inconsistencies or issues with the dark mode implementation, please feel free to point them out, and I'll address them promptly. Dark Mode Colors: I have carefully selected the new dark mode colors to ensure a visually appealing and consistent experience. However, I would appreciate your feedback and input from the design team (@runemadsen, @jasontheillustrator) to ensure that the chosen colors align with the project's branding and design principles. Next Steps: I plan to create a pull request with the updated dark mode implementation. This will allow the all of you to review the changes, provide feedback, and contribute to further refinements if necessary. Please let me know if you have any additional suggestions or concerns. I'm happy to make any necessary adjustments to ensure a successful integration of the dark mode feature. Thank you again for your guidance and collaboration! |
That sounds amazing @Yashasewi! It's wonderful that you took the time to make the use of CSS variables even better. Can't wait to review the PR, so let me know when it's ready :) |
Thank you, @jasontheillustrator! I'm glad you liked CSS variables approach. I'll keep you updated and notify you once ready for review. |
Hi everyone, I've completed the implementation of the dark mode feature, and I'm excited to share that I've created a pull request for your review and feedback. Pull Request: #1554 Dark Mode Implementation In this pull request, I've addressed the following:
Please take a look at the pull request description for more details on the implementation, potential issues, screenshots, and next steps. I would greatly appreciate it if you could review the changes and provide your feedback. I'm happy to address any concerns or make further adjustments as needed. Thank you for your collaboration and support throughout this process. I'm looking forward to your valuable insights and working together to ensure a seamless integration of the dark mode feature. |
Dark Mode Feature Proposal
Description:
As a user of thecodingtrain website, I often find myself browsing late at night or in low-light environments where a dark mode would be more comfortable for my eyes. I propose adding a dark mode feature to the website to enhance user experience and accessibility.
Benefits:
Additional Notes:
Preview:
Dark Mode
Desktop
Small Screen (Mobile/Tablet)
Light Mode
Desktop
Small Screen (Mobile/Tablet)
Feel free to provide any feedback or suggestions for improving this feature.
Once I complete the user preferences part, I will proceed to create a pull request. @shiffman
The text was updated successfully, but these errors were encountered: