File tree Expand file tree Collapse file tree 3 files changed +6
-13
lines changed
Expand file tree Collapse file tree 3 files changed +6
-13
lines changed Original file line number Diff line number Diff line change 11"use client" ;
22
33import { Global , ThemeProvider } from "@emotion/react" ;
4- import Script from "next/script " ;
4+ import { useEffect } from "react " ;
55import { RecoilRoot } from "recoil" ;
66
77import { rootThemeSetting } from "@/utils/dom" ;
@@ -13,10 +13,14 @@ export const ScriptDom = () => {
1313 const stringifyFn = String ( rootThemeSetting ) ;
1414 const fnToRunOnClient = `(${ stringifyFn } )()` ;
1515
16- return < Script dangerouslySetInnerHTML = { { __html : fnToRunOnClient } } /> ;
16+ return < script dangerouslySetInnerHTML = { { __html : fnToRunOnClient } } /> ;
1717} ;
1818
1919export default function Provider ( props : React . PropsWithChildren ) {
20+ useEffect ( ( ) => {
21+ document . body . style . transition = "background var(--delay)" ;
22+ } , [ ] ) ;
23+
2024 return (
2125 < ThemeProvider theme = { baseTheme } >
2226 < Global styles = { GlobalStyle ( baseTheme ) } />
Original file line number Diff line number Diff line change @@ -39,11 +39,6 @@ const GlobalStyle = (theme: Theme) => css`
3939 body {
4040 color : var (--black );
4141 background-color : var (--white );
42- transition : background var (--delay );
43- -moz-transition : background var (--delay );
44- -webkit-transition : background var (--delay );
45- -ms-transition : background var (--delay );
46- -o-transition : background var (--delay );
4742 & .modal-open {
4843 overflow : hidden;
4944 padding-right : 1rem ;
Original file line number Diff line number Diff line change @@ -16,12 +16,6 @@ export function rootThemeSetting() {
1616
1717export function modalOpenPadding ( ) {
1818 try {
19- var root = document . documentElement ;
20- var themeStorage = localStorage . getItem ( "theme" ) ;
21-
22- if ( themeStorage ) {
23- root . setAttribute ( "data-theme" , themeStorage ) ;
24- }
2519 } catch ( e ) {
2620 console . log ( e ) ;
2721 }
You can’t perform that action at this time.
0 commit comments