- Print
- DarkLight
- PDF
How to keep dark mode for the Knowledge base site by default?
Article Summary
Share feedback
Thanks for sharing your feedback!
Users use the Light/Dark option at the top of the article to change the theme. By default, all articles would be in Light mode. If you want to enable the Dark by default, you can use the below solution.
Solution
- Go to Settings → Knowledge base site → Custom CSS & JavaScript → Custom JavaScript
- Paste the below JavaScript in the window
$(document).ready(function() {
setTimeout(function() { document.getElementById('darkTheme').click(); }, 100);
});
- Click Save
- Now, all the articles on your site appear in dark mode by default. However, the user can switch to light mode with the Light option at the top of the article
- If you want the user to view only in dark mode, you can disable the theme option in Article settings.
- Go to Settings → Knowledge base site → Article settings
- Under Article header, you can find the 'Show theme options' toggle
- Toggle it to Off
Was this article helpful?