Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

react-next-theme

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-next-theme - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

5

package.json
{
"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": [

12

scripts/themeScript.js

@@ -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();
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc