@jill64/svelte-device-theme
Advanced tools
Comparing version 1.0.4 to 1.0.5
import { readable } from 'svelte/store'; | ||
export var isDark = readable(typeof window !== 'undefined' | ||
export const isDark = readable(typeof window !== 'undefined' | ||
? matchMedia('(prefers-color-scheme: dark)').matches | ||
: undefined, function (set) { | ||
: undefined, (set) => { | ||
if (typeof window !== 'undefined') { | ||
matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function (e) { return set(e.matches); }); | ||
matchMedia('(prefers-color-scheme: dark)').addEventListener('change', (e) => set(e.matches)); | ||
} | ||
}); |
{ | ||
"name": "@jill64/svelte-device-theme", | ||
"description": "A simple store that syncs with your device's theme settings", | ||
"version": "1.0.4", | ||
"version": "1.0.5", | ||
"main": "dist/index.js", | ||
@@ -33,5 +33,5 @@ "type": "module", | ||
"scripts": { | ||
"build": "tsc && publint", | ||
"lint": "prettier --check . && eslint .", | ||
"format": "prettier --write ." | ||
"build": "tsc && npx publint", | ||
"lint": "npx prettier --check . && npx eslint", | ||
"format": "npx prettier --write ." | ||
}, | ||
@@ -44,5 +44,2 @@ "peerDependencies": { | ||
"@typescript-eslint/parser": "6.7.4", | ||
"eslint": "8.50.0", | ||
"prettier": "3.0.3", | ||
"publint": "0.2.3", | ||
"typescript": "5.2.2" | ||
@@ -49,0 +46,0 @@ }, |
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
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
3
3157