preferred-color-scheme
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

🔆 preferred-color-scheme 🌙

Really small package exporting utility functions to read the user's preferred color scheme. It can be useful when trying to match web applications colors to macOS theme selection.

Installation and usage

yarn add preferred-color-scheme
npm install preferred-color-scheme
import { getPreferredColorScheme } from 'preferred-color-scheme';

const preferredColorScheme = getPreferredColorScheme();

API

getPreferredColorScheme

Calculate which ColorScheme is the user's preferred one

➡️ returns ColorScheme: either "dark", "ligh", or "no-preference"

Readme

Keywords

none

Package Sidebar

Install

npm i preferred-color-scheme

Weekly Downloads

4

Version

1.1.0

License

MIT

Unpacked Size

8.82 kB

Total Files

14

Last publish

Collaborators

  • thibthib