Skip to content

Commit

Permalink
πŸ“š Improve documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
thibthib committed Mar 13, 2019
1 parent 86ba16f commit 5aa9718
Show file tree
Hide file tree
Showing 3 changed files with 686 additions and 554 deletions.
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# πŸ”† 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"
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
{
"name": "preferred-color-scheme",
"description": "Small package exporting utility functions to read the user's preferred color scheme",
"version": "1.0.0",
"main": "src/index.ts",
"repository": "git@github.com:DataDog/preferred-color-scheme.git",
"author": "Thibaut Dutartre <t.dutartre@gmail.com>",
"author": "Datadog <dev@datadog.com> (http://www.datadog.com)",
"contributors": [
"Thibaut Dutartre <t.dutartre@gmail.com> (https://github.com/thibthib)"
],
"license": "MIT",
"scripts": {
"build": "pack build",
Expand Down
Loading

0 comments on commit 5aa9718

Please sign in to comment.