improved static styles and x-browser scrollbars

This commit is contained in:
Ben Phelps 2022-09-30 22:13:37 +03:00
parent 2271cc0044
commit f52c6f3b41
5 changed files with 61 additions and 27 deletions

View file

@ -20,7 +20,7 @@ export function ColorProvider({ initialTheme, children }) {
const [color, setColor] = useState(getInitialColor);
const rawSetColor = (rawColor) => {
const root = window.document.documentElement;
const root = window.document.getElementById("page_wrapper");
root.classList.remove(`theme-${lastColor}`);
root.classList.add(`theme-${rawColor}`);

View file

@ -22,7 +22,7 @@ export function ThemeProvider({ initialTheme, children }) {
const [theme, setTheme] = useState(getInitialTheme);
const rawSetTheme = (rawTheme) => {
const root = window.document.documentElement;
const root = window.document.getElementById("page_wrapper");
const isDark = rawTheme === "dark";
root.classList.remove(isDark ? "light" : "dark");