Quantcast
Viewing all articles
Browse latest Browse all 164

Dark Mode Switcher For Bootstrap 4

Image may be NSFW.
Clik here to view.
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>

The post Dark Mode Switcher For Bootstrap 4 appeared first on CSS Script.


Viewing all articles
Browse latest Browse all 164

Trending Articles