mirror of
https://github.com/cupcakearmy/use-light-switch.git
synced 2024-12-22 07:56:26 +00:00
Update README.md
This commit is contained in:
parent
317e771d2e
commit
6f816958f4
@ -25,6 +25,15 @@ npm i use-light-switch
|
|||||||
|
|
||||||
There was no library that included typings 🤕
|
There was no library that included typings 🤕
|
||||||
|
|
||||||
|
## 🛠 Compatibility & How it works
|
||||||
|
|
||||||
|
We leverage two browser features.
|
||||||
|
|
||||||
|
1. [prefers-color-scheme](https://caniuse.com/#feat=prefers-color-scheme) media query.
|
||||||
|
2. [matchMedia](https://caniuse.com/#feat=matchmedia)
|
||||||
|
|
||||||
|
The first one is a css media query that gives us the actual user preference. with `window.matchMedia` we can get it inside of javascript and even listen on changes, which makes it reactive.
|
||||||
|
|
||||||
## 🚀 Quickstart
|
## 🚀 Quickstart
|
||||||
|
|
||||||
```typescript
|
```typescript
|
||||||
|
Loading…
Reference in New Issue
Block a user