@jill64/svelte-device-theme
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -1,7 +0,2 @@ | ||
import { readable } from 'svelte/store'; | ||
import { BROWSER } from 'esm-env'; | ||
export const isDark = readable(BROWSER ? matchMedia('(prefers-color-scheme: dark)').matches : undefined, (set) => { | ||
if (BROWSER) { | ||
matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => set(e.matches)); | ||
} | ||
}); | ||
import { listen } from 'svelte-mq-store'; | ||
export const isDark = listen('(prefers-color-scheme: dark)'); |
{ | ||
"name": "@jill64/svelte-device-theme", | ||
"description": "🖥️ A simple store that syncs with your device's theme settings", | ||
"version": "1.2.0", | ||
"description": "☯ A simple store that syncs with your device's theme settings", | ||
"version": "1.2.1", | ||
"main": "dist/index.js", | ||
@@ -27,2 +27,3 @@ "type": "module", | ||
"keywords": [ | ||
"dark-mode", | ||
"device", | ||
@@ -46,11 +47,11 @@ "media", | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "6.9.1", | ||
"@typescript-eslint/parser": "6.9.1", | ||
"@typescript-eslint/eslint-plugin": "6.12.0", | ||
"@typescript-eslint/parser": "6.12.0", | ||
"eslint-plugin-deprecation": "2.0.0", | ||
"svelte": "4.2.2", | ||
"typescript": "5.2.2" | ||
"svelte": "4.2.7", | ||
"typescript": "5.3.2" | ||
}, | ||
"dependencies": { | ||
"esm-env": "1.0.0" | ||
"svelte-mq-store": "0.0.1" | ||
} | ||
} |
@@ -7,5 +7,5 @@ <!----- BEGIN GHOST DOCS HEADER -----> | ||
🖥️ A simple store that syncs with your device's theme settings | ||
☯ A simple store that syncs with your device's theme settings | ||
## Install | ||
## Installation | ||
@@ -20,4 +20,2 @@ ```sh | ||
Note: `$isDark` is `undefined` on the server | ||
```svelte | ||
@@ -34,1 +32,5 @@ <script> | ||
``` | ||
> [!NOTE] | ||
> `$isDark` is `undefined` on the server. | ||
> If you need full theme management including SSR, please see [@jill64/svelte-dark-theme](https://github.com/jill64/svelte-dark-theme). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
34
3757
4
+ Addedsvelte-mq-store@0.0.1
+ Addedsvelte-mq-store@0.0.1(transitive)
- Removedesm-env@1.0.0