@jill64/svelte-device-theme
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -1,7 +0,8 @@ | ||
import { BROWSER } from 'esm-env'; | ||
import { readable } from 'svelte/store'; | ||
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)); | ||
export var isDark = readable(typeof window !== 'undefined' | ||
? matchMedia('(prefers-color-scheme: dark)').matches | ||
: undefined, function (set) { | ||
if (typeof window !== 'undefined') { | ||
matchMedia('(prefers-color-scheme: dark)').addEventListener('change', function (e) { return set(e.matches); }); | ||
} | ||
}); |
{ | ||
"name": "@jill64/svelte-device-theme", | ||
"description": "A simple store that syncs with your device's theme settings", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"main": "dist/index.js", | ||
@@ -29,2 +29,5 @@ "type": "module", | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"scripts": { | ||
@@ -39,9 +42,8 @@ "build": "tsc && publint", | ||
"devDependencies": { | ||
"@typescript-eslint/eslint-plugin": "^6.6.0", | ||
"@typescript-eslint/parser": "^6.6.0", | ||
"eslint": "^8.48.0", | ||
"esm-env": "^1.0.0", | ||
"prettier": "^3.0.3", | ||
"publint": "^0.2.2", | ||
"typescript": "^5.2.2" | ||
"@typescript-eslint/eslint-plugin": "6.7.0", | ||
"@typescript-eslint/parser": "6.7.0", | ||
"eslint": "8.49.0", | ||
"prettier": "3.0.3", | ||
"publint": "0.2.2", | ||
"typescript": "5.2.2" | ||
}, | ||
@@ -48,0 +50,0 @@ "dependencies": { |
# svelte-device-theme | ||
![github-actions-ci](https://github.com/jill64/svelte-device-theme/actions/workflows/ci.yml/badge.svg) | ||
A simple store that syncs with your device's theme settings | ||
@@ -4,0 +6,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
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
3238
6
10
28