- 
                Notifications
    You must be signed in to change notification settings 
- Fork 1.7k
feat(docs): Enable dark mode toggle #18285
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
base: main
Are you sure you want to change the base?
Conversation
        
          
                docs/source/conf.py
              
                Outdated
          
        
      | # "License"); you may not use this file except in compliance | ||
| # with the License. You may obtain a copy of the License at | ||
| # | ||
| # http://www.apache.org/licenses/LICENSE-2.0 | 
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.
Is this a copy paste error? Looks like it's duplicating lines in the file
|  | ||
| html_theme_options = { | ||
| "use_edit_page_button": True, | ||
| "navbar_end": ["theme-switcher", "navbar-icon-links"], | 
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.
Pushed a commit that removed the extra copy of the config
However, when I tested this locally I didn't see any switcher buttons
@VedantSawant616 can you provide some help about how you tested / what I should look for?
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.
hi @alamb, thanks for checking!
this is almost always a sphinx caching issue.
1.please run a clean build from the docs/directory(on windows cmd)
 make.bat clean && make.bat html
2.after that, you might also need to do a hard refresh in your browser
you would be able to see afterwards
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 provide a screenshot showing this is the case? I also tried locally and can't see the toggle, even with a hard refresh. Perhaps see @foskey51's comment for reference on what might need to be done 🤔
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.
| Marking as draft as we work through the review | 
| hey @alamb 
 apparently to view the toggle we need unblock the navbar by removing the following part in file  
 so this would result in something like this just a quick question "Is the navbar blocked for any reason ??" | 
| 
 I assume it's blocked to avoid having that top bar of links which doesn't look particularly good (at least in its default form) | 
| This might be superseded by #18324? Looks like we have two PRs for the same issue now | 


Which issue does this PR close?
Rationale for this change
This PR adds the dark mode toggle button to the documentation website, as requested in issue #18284.
What changes are included in this PR?
Edited docs/conf.py to add "theme-switcher" to the html_theme_options.
Are these changes tested?
Yes, I built the docs locally and confirmed the toggle appears and works.
Are there any user-facing changes?
Yes, users will now see a dark mode toggle on the website.