react-next-theme
Advanced tools
Comparing version 1.0.3 to 1.0.4
{ | ||
"name": "react-next-theme", | ||
"version": "1.0.3", | ||
"version": "1.0.4", | ||
"type": "module", | ||
@@ -14,4 +14,3 @@ "description": "A simple and flexible theme switcher for React and Next.js, supporting light and dark modes with localStorage and system preferences.", | ||
"dist", | ||
"scripts/themeScript.js", | ||
"src" | ||
"scripts/themeScript.js" | ||
], | ||
@@ -18,0 +17,0 @@ "keywords": [ |
@@ -1,9 +0,3 @@ | ||
(function () { | ||
const storedTheme = localStorage.getItem('theme'); | ||
if (storedTheme) { | ||
document.documentElecment.setAttribute('data-theme', storedTheme); | ||
} else { | ||
const prefersDark = window.matchMedia('(prefers-color-scheme: dark)').matches; | ||
document.documentElement.setAttribute('data-theme', prefersDark ? 'dark' : 'light'); | ||
} | ||
})() | ||
import { applyTheme } from "../utils/theme"; | ||
applyTheme(); |
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
7047
3
1
1