mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-10-27 19:15:48 -04:00
remove no-fade stylesheet from DOM after use
This commit is contained in:
@@ -26,7 +26,7 @@ const Layout = ({ noContainer, className, children, ...rest }: LayoutProps) => {
|
|||||||
/>
|
/>
|
||||||
|
|
||||||
{/* kinda a hack to prevent dramatically fading into dark theme if we're immediately setting it on load */}
|
{/* kinda a hack to prevent dramatically fading into dark theme if we're immediately setting it on load */}
|
||||||
<style>{`.page.no-fade,.page.no-fade *{transition:none!important}`}</style>
|
<style id="no-fade-css">{`.page.no-fade,.page.no-fade *{transition:none!important}`}</style>
|
||||||
|
|
||||||
{/* dynamically set browser theme color to match the background color */}
|
{/* dynamically set browser theme color to match the background color */}
|
||||||
<meta name="theme-color" content={themes[resolvedTheme || "light"]["background-outer"]} />
|
<meta name="theme-color" content={themes[resolvedTheme || "light"]["background-outer"]} />
|
||||||
@@ -34,7 +34,7 @@ const Layout = ({ noContainer, className, children, ...rest }: LayoutProps) => {
|
|||||||
|
|
||||||
{/* remove the `.no-fade` class above from body once the page is finished loading */}
|
{/* remove the `.no-fade` class above from body once the page is finished loading */}
|
||||||
<Script id="unblock-transitions" strategy="lazyOnload">
|
<Script id="unblock-transitions" strategy="lazyOnload">
|
||||||
{`try{document.body.classList.remove("no-fade")}catch(e){}`}
|
{`try{document.body.classList.remove("no-fade");document.getElementById("no-fade-css").remove()}catch(e){}`}
|
||||||
</Script>
|
</Script>
|
||||||
|
|
||||||
<div className={classNames(styles.flex, className)} {...rest}>
|
<div className={classNames(styles.flex, className)} {...rest}>
|
||||||
|
|||||||
Reference in New Issue
Block a user