--- title: "How to keep dark mode for the Knowledge base site by default" slug: "how-to-keep-dark-mode-for-the-knowledge-base-site-by-default" description: "You can use the Light or Dark option at the top of the article to change the theme. " tags: ["Customization"] updated: 2026-06-20T09:44:22Z published: 2026-06-20T09:44:22Z canonical: "docs.document360.com/how-to-keep-dark-mode-for-the-knowledge-base-site-by-default" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.document360.com/llms.txt > Use this file to discover all available pages before exploring further. # How to keep dark mode for the Knowledge base site by default By default, all articles on your knowledge base site display in Light mode. Readers can manually switch between Light and Dark using the theme toggle at the top of each article. If you want Dark mode to be the default experience, so readers arrive on Dark without having to switch, you can implement this using a JavaScript snippet. You can also lock the site to Dark only, removing the toggle entirely so readers always view in Dark mode. --- ## When to use this Use this customization when you want to: - Match your brand identity with a dark-themed knowledge base as the first impression for all readers. - Reduce eye strain for readers who primarily read technical documentation in low-light environments. - Lock the experience to Dark only, ensuring a consistent visual presentation regardless of reader preference. --- ## Before you begin - You need access to **Settings** (
) > **Knowledge base site** > **Site customization** > **Custom CSS & JavaScript** in the Knowledge base portal. - Dark mode as default still allows readers to switch to Light mode using the theme toggle at the top of each article. If you want to remove this toggle and enforce Dark mode, complete both parts of this guide.--- ## Part 1 - Set Dark mode as the default 1. Navigate to **Settings** () > **Knowledge base site** > **Site customization** > **Custom CSS & JavaScript** in the Knowledge base portal.  2. From the left navigation pane, select the **JavaScript** tab and paste the following snippet: ```javascript $(document).ready(function() { setTimeout(function() { document.getElementById('darkTheme').click(); }, 100); }); ``` 3. Click **Save**.  All articles on your knowledge base site now load in Dark mode by default. Readers can still switch to Light mode using the **Light** option at the top of any article. --- ## Part 2 - Lock the site to Dark mode only (optional) If you want readers to view the site exclusively in Dark mode, with no option to switch to Light, turn off the theme toggle in Site customization. 1. Navigate to **Settings** () > **Knowledge base site** in the left navigation bar in the Knowledge base portal. 2. In the left navigation pane, navigate to **Site customization**. 3. Under the **Site theme** section, select the **Dark only** option and click **Save** at the top.  The theme toggle is now removed from all articles. Readers will always view your knowledge base in Dark mode. --- ## Best practices - **Apply Part 1 and Part 2 together if you need full Dark enforcement.** Part 1 alone defaults to Dark but leaves the toggle visible; a reader can still switch to Light. If brand consistency matters, complete Part 2 to remove the toggle. - **Test across your most-visited articles.** After enabling Dark mode as the default, check articles that contain images, tables, and callouts. Some content with hardcoded light backgrounds may need additional CSS adjustments to remain readable in Dark mode. - **Consider your audience before locking to Dark only.** Some readers with accessibility needs or specific display settings prefer Light mode. Removing the toggle takes away their choice; use the lock only when your use case strongly requires it.NOTEBy default, all articles display in Light mode. The JavaScript snippet below overrides this so Dark mode is applied on page load.