@jojoee/is-darkmode

1.0.1 • Public • Published

is-darkmode

Travis GitHub issues GitHub license GitHub release semantic-release

Is macOS using Dark appearance, see demo page.

Demo

Installation

// via githack
<script src="https://rawcdn.githack.com/jojoee/is-darkmode/v1.0.0/index.js"></script>

// via Bower
bower install jojoee/is-darkmode --save
<script src="./bower_components/is-darkmode/index.js"></script>

// via CommonJS
npm install @jojoee/is-darkmode --save
const { isDarkMode, onDarkModeChange } = require('@jojoee/is-darkmode')

// via ES6
import { isDarkMode, onDarkModeChange } from "@jojoee/is-darkmode"

Usage

isDarkMode() // returns Boolean

onDarkModeChange(function (isDark) {
  console.log('isDark', isDark)
})

Dependencies (0)

    Dev Dependencies (8)

    Package Sidebar

    Install

    npm i @jojoee/is-darkmode

    Weekly Downloads

    3

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    7.84 kB

    Total Files

    10

    Last publish

    Collaborators

    • jojoee