Skip to content

LittleToni/color-scheme-detector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Color Scheme Detector

This package enables detection of a user's preferred color scheme (dark or light mode) in a browser environment.

Installation

npm install color-scheme-detector

Usage

import {
  isColorSchemeSupported,
  isDarkModeEnabled,
  isLightModeEnabled,
  detectColorScheme
} from 'color-scheme-detector';
  • isColorSchemeSupported(): Checks if color scheme detection is supported.
  • isDarkModeEnabled(): Checks if dark mode is enabled.
  • isLightModeEnabled(): Checks if light mode is enabled.
  • detectColorScheme(): Detects the user's preferred color scheme, returning 'dark', 'light' or 'unsupported'.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published