Get unlimited public & private packages + package-based permissions with npm Pro.Get started »

darkdetector

0.0.2 • Public • Published

Travis CI Build Status CodeFactor Score

Dark Detector

NPM

Detect dark mode in any browser.

Importing

From your NodeJS application:

const DarkDetector = require("darkdetector")

From your web application:

<script src="https://unpkg.com/darkdetector/darkdetector.min.js"></script>

Usage

// Check if dark mode enabled
if (DarkDetector({
    query: true, // Check for dark mode media query
    highcontrast: false, // Check for white on black media query
    bodyclass: false, // Check for class on body class
    time: false // Check for night time
})) console.log("Dark mode is enabled.")

Keywords

none

Install

npm i darkdetector

DownloadsWeekly Downloads

0

Version

0.0.2

License

MIT

Unpacked Size

40 kB

Total Files

9

Last publish

Collaborators

  • avatar