mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2025-10-23 12:54:25 -04:00
fix the fixes....
This commit is contained in:
@@ -152,9 +152,12 @@ export default function App({ Component, pageProps }: AppProps) {
|
|||||||
{/* Inline script to restore light/dark theme preference ASAP */}
|
{/* Inline script to restore light/dark theme preference ASAP */}
|
||||||
<Script id="restore_theme" strategy="afterInteractive">{`
|
<Script id="restore_theme" strategy="afterInteractive">{`
|
||||||
try {
|
try {
|
||||||
var pref = localStorage.getItem("dark_mode"),
|
var root = document.documentElement,
|
||||||
dark = pref === "true" || (!pref && window.matchMedia("(prefers-color-scheme: dark)").matches);
|
pref = localStorage.getItem("dark_mode"),
|
||||||
document.documentElement.setAttribute("data-theme", dark ? "dark" : "light");
|
theme = pref === "true" || (!pref && window.matchMedia("(prefers-color-scheme: dark)").matches) ? "dark" : "light";
|
||||||
|
|
||||||
|
root.setAttribute("data-theme", theme);
|
||||||
|
root.style.colorScheme = theme;
|
||||||
} catch (e) {}`}</Script>
|
} catch (e) {}`}</Script>
|
||||||
|
|
||||||
<Component {...pageProps} />
|
<Component {...pageProps} />
|
||||||
|
@@ -1,5 +1,3 @@
|
|||||||
/* stylelint-disable no-duplicate-selectors */
|
|
||||||
|
|
||||||
:root {
|
:root {
|
||||||
--background-inner: #ffffff;
|
--background-inner: #ffffff;
|
||||||
--background-outer: #fcfcfc;
|
--background-outer: #fcfcfc;
|
||||||
@@ -35,13 +33,3 @@
|
|||||||
--success: #78df55;
|
--success: #78df55;
|
||||||
--error: #ff5151;
|
--error: #ff5151;
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://web.dev/color-scheme/#the-color-scheme-css-property
|
|
||||||
|
|
||||||
:root {
|
|
||||||
color-scheme: light;
|
|
||||||
}
|
|
||||||
|
|
||||||
[data-theme="dark"] {
|
|
||||||
color-scheme: dark;
|
|
||||||
}
|
|
||||||
|
1
styles/_reset.scss
Normal file
1
styles/_reset.scss
Normal file
@@ -0,0 +1 @@
|
|||||||
|
@import "~modern-normalize/modern-normalize.css";
|
@@ -1,7 +1,4 @@
|
|||||||
// Browser reset:
|
@use "reset";
|
||||||
// https://github.com/sindresorhus/modern-normalize
|
|
||||||
@import "~modern-normalize/modern-normalize.css";
|
|
||||||
|
|
||||||
@use "typography";
|
@use "typography";
|
||||||
@use "colors";
|
@use "colors";
|
||||||
@use "syntax";
|
@use "syntax";
|
||||||
|
Reference in New Issue
Block a user