Spotlight Effect In JavaScript – Dark Light Mode

Category: Javascript | September 9, 2021
Views Total:365 views
Official Page:Go to website
Last Update:September 9, 2021


Spotlight Effect In JavaScript – Dark Light Mode


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 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=""></script>

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

<dark-light-mode />

You Might Be Interested In:

Leave a Reply