-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
686 additions
and
554 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.