1.1.0 ⢠Published 6 years ago
preferred-color-scheme v1.1.0
š 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-schemenpm install preferred-color-schemeimport { 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"