Dark Mode Switcher For Bootstrap 4

Category: Javascript | February 14, 2020
Views Total:3,743 views
Official Page:Go to website
Last Update:February 14, 2020
License:BSD 3-Clause


Dark Mode Switcher For Bootstrap 4


A tiny JavaScript & CSS implementation of the trending dark mode theme for Bootstrap 4 framework.

It saves user preference to the browser’s local storage as other dark mode plugins & scripts. jQuery and Bootstrap 4’s JS are OPTIONAL.

How to use it:

1. Load the stylesheet darktheme.css after Bootstrap’s stylesheet.

<link rel="stylesheet" href="darktheme.css" />

2. Load the core JavaScript theme.js right before the closing body tag.

<script src="theme.js"></script>

3. Load the darkswitch.js script on the webpage where you’d like to show the dark mode toggle switch. That’s it.

<script src="darkswitch.js"></script>

You Might Be Interested In:

Leave a Reply