Implement Dark Mode With A Single Line Of Code – Nightowl

Category: Color , Javascript , Recommended | December 6, 2023
Author:bufferhead-code
Views Total:340 views
Official Page:Go to website
Last Update:December 6, 2023
License:MIT

Preview:

Implement Dark Mode With A Single Line Of Code – Nightowl

Description:

A dead simple dark mode TypeScript library that instantly transforms any website into a soothing, eye-friendly dark theme with a single click.

With just a single line of code, nightowl automatically creates a dark mode switch button in the top right corner that lets users toggle between dark and light themes. This not only enhances user experience but also caters to the growing preference for dark mode among internet users.

How to use it:

1. Install & download.

# NPM
$ npm i Nightowl

2. Load the nightowl.js library as a module. That’s it.

<script type="module" src="/dist/nightowl.js"></script>

You Might Be Interested In:


Leave a Reply