Spotlight Effect In JavaScript – Dark Light Mode

Category: Javascript | September 9, 2021
Author:justjavac
Views Total:312 views
Official Page:Go to website
Last Update:September 9, 2021
License:MIT

Preview:

Spotlight Effect In JavaScript – Dark Light Mode

Description:

An alternative implementation of the dark mode that applies a spotlight effect to the entire page when the Dark Mode is activated.

How to use it:

1. Install & download the package with package manager.

# Yarn
$ yarn add dark-light-mode
# NPM
$ npm i dark-light-mode --save

2. Import the Dark Light Mode as a module.

<script type="module" src="./src/dark-light-mode.mjs"></script>

3. Or from a CDN.

<script type="module" src="https://unpkg.com/dark-light-mode"></script>

4. Create a dark mode switcher on the page. That’s it.

<dark-light-mode />

You Might Be Interested In:


Leave a Reply