Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

is-dark-theme

justjavac37MIT1.0.3TypeScript support: included

Detect if the user has requested the system use a light or dark color theme

dark, light, ui, css, media, query, prefers, scheme, color

readme

is-dark-theme

Detect if the user has requested the system use a light or dark color theme.

npm package

Build Status NPM version NPM Downloads Install Size

Installation

Install the package using npm or yarn.

use npm:

npm install is-dark-theme

or use yarn:

yarn add is-dark-theme

Usage

import isDarkTheme from 'is-dark-theme'

isDarkTheme() // true | false

Credits

License

is-dark-theme is released under the MIT License. See the bundled LICENSE file for details.