Skip to content
This repository has been archived by the owner on Jun 23, 2021. It is now read-only.

Dark Mode for subpages #76

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft

Dark Mode for subpages #76

wants to merge 2 commits into from

Conversation

ShrillShrestha
Copy link

@ShrillShrestha ShrillShrestha commented Feb 5, 2021

Changes

Dark mode for subpages. Continuation for #55

How Has This Been Tested?

I tested the changes locally in the chrome browser for mac.

Mentions

@RashikaKarki, @wrussell1999, @Korusuke
Also, right now the subpages don't inherit dark mode from the home page (they have their own toggle button). I am trying to make it inherit to subpages. So, if you have any advice/ tips on how I can make that happen, I am happy to hear them.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature and improvements (non-breaking change which adds/improves functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Code Refactoring (an internal change which is not user-facing)
  • Documentation
  • Test, CI, or build

Checklist

  • Coding style of this project is followed
  • Change in documentation is required
  • Documentation has been updated accordingly
  • Unit tests have been added to cover code change

@ShrillShrestha ShrillShrestha marked this pull request as draft February 5, 2021 17:26
@ShrillShrestha
Copy link
Author

@Korusuke, the dark mode is acting weird. @RashikaKarki tried checking the dark mode, and the subpages were inheriting the dark mode. But I tried on my browser and it looks like it's not working. I am not sure if it's because we are using different systems. I am using macOS, and Rashika is using Windows. We also tried every browser(Chrome, Mozilla,...) we have. Do you have any suggestions on what I should be doing next?


console.log(imode);
if(imode == "true"){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if(imode == "true"){
if (imode === null) {
localStorage.setItem("isDark", false);
}
if(imode == "true"){

Copy link
Member

@jkmartindale jkmartindale left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I played around with this branch, and adding a null check for isDark and setting it to a default value made dark theme inheritance work better for me. Maybe that'll fix the issue you're seeing?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants