# preferred-color-scheme

> Small package exporting utility functions to read the user's preferred color scheme

Latest version **1.1.0** (published 2019-08-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install preferred-color-scheme
pnpm add preferred-color-scheme
yarn add preferred-color-scheme
bun add preferred-color-scheme
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2019-08-21 |
| First published | 2019-03-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 8.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | thibthib |

## Links

- npm: https://www.npmjs.com/package/preferred-color-scheme
- Repository: git@github.com:DataDog/preferred-color-scheme
- npm.io page: https://npm.io/package/preferred-color-scheme

## Recent versions

- 1.1.0 (latest) — 2019-08-21
- 1.0.0 — 2019-03-13

## README

# 🔆 preferred-color-scheme 🌙

[Really small](https://bundlephobia.com/result?p=preferred-color-scheme@1.0.0) package exporting utility functions to read the user's [preferred color scheme](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-color-scheme). It can be useful when trying to match web applications colors to macOS theme selection.

## Installation and usage

```bash
yarn add preferred-color-scheme
```

```bash
npm install preferred-color-scheme
```

```js
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"

---
_Source: https://npm.io/package/preferred-color-scheme · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
