UNPKG

nextjs-darkmode

Version:

Unleash the Power of React Server Components! Use dark/light mode on your site with confidence, without losing any advantages of React Server Components

2 lines (1 loc) 654 B
import{a as s}from"./chunk-CIZY7VY5.mjs";import{a}from"./chunk-RYSNTC6D.mjs";import{b as m,c as p}from"./chunk-24GHFFXD.mjs";import{jsx as S}from"react/jsx-runtime";var c,o,l=({n:e,k:t,t:r})=>S("script",{suppressHydrationWarning:!0,dangerouslySetInnerHTML:{__html:`(${s.toString()})(${[t,r,e].map(n=>`'${n}'`)})`},nonce:e}),L=({t:e="none",nonce:t="",k:r="o"})=>{let n=typeof window!="undefined";n&&!window.q&&s(r,e,t);let[{m:f,s:g},d]=a();return!o&&n&&([c,o]=[q,u],c.addEventListener("change",()=>d(i=>({...i,s:c.matches?m:p}))),addEventListener("storage",i=>{i.key===r&&d(h=>({...h,m:i.newValue}))})),o==null||o(f,g),S(l,{n:t,k:r,t:e})};export{L as a};