1
Fork 0
mirror of https://github.com/Steffo99/unisteffo.git synced 2024-11-25 09:24:21 +00:00

Make overflows readable with any theme

This commit is contained in:
Steffo 2022-02-07 11:39:30 +01:00
parent dc640b0fa0
commit bd01c058a2
3 changed files with 17 additions and 7 deletions

View file

@ -10,7 +10,7 @@
"dependencies": { "dependencies": {
"@matejmazur/react-katex": "^3.1.3", "@matejmazur/react-katex": "^3.1.3",
"@sentry/nextjs": "^6.17.4", "@sentry/nextjs": "^6.17.4",
"@steffo/bluelib-react": "^4.4.2", "@steffo/bluelib-react": "^4.4.3",
"katex": "^0.15.2", "katex": "^0.15.2",
"next": "12.0.10", "next": "12.0.10",
"react": "17.0.2", "react": "17.0.2",

View file

@ -1,7 +1,7 @@
import "../styles/global.css" import "../styles/global.css"
import type { AppProps } from 'next/app' import type { AppProps } from 'next/app'
import { Link } from "../components/link" import { Link } from "../components/link"
import {Bluelib, Heading, LayoutThreeCol, Anchor as A, Footer} from "@steffo/bluelib-react" import {Bluelib, Heading, LayoutThreeCol, Anchor as A, Footer, useBluelib} from "@steffo/bluelib-react"
import { useState, useEffect, useRef } from "react" import { useState, useEffect, useRef } from "react"
import { BluelibTheme } from "@steffo/bluelib-react/dist/types" import { BluelibTheme } from "@steffo/bluelib-react/dist/types"
import { Theme } from "../components/theme-switcher" import { Theme } from "../components/theme-switcher"
@ -9,7 +9,17 @@ import { Theme } from "../components/theme-switcher"
function MyApp({ Component, pageProps }: AppProps) { function MyApp({ Component, pageProps }: AppProps) {
const [theme, setTheme] = useState<BluelibTheme>("sophon") const [theme, setTheme] = useState<BluelibTheme>("sophon")
const ref = useRef<HTMLBodyElement | null>(null)
useEffect(
() => {
ref.current = document.body as HTMLBodyElement
},
[ref]
)
useBluelib(ref, {
theme,
})
return ( return (
<Theme.Provider value={[theme, setTheme]}> <Theme.Provider value={[theme, setTheme]}>

View file

@ -278,10 +278,10 @@
dependencies: dependencies:
"@sentry/cli" "^1.72.0" "@sentry/cli" "^1.72.0"
"@steffo/bluelib-react@^4.4.2": "@steffo/bluelib-react@^4.4.3":
version "4.4.2" version "4.4.3"
resolved "https://registry.yarnpkg.com/@steffo/bluelib-react/-/bluelib-react-4.4.2.tgz#3a737ea2825530a51bdde66d4564d12e73feecda" resolved "https://registry.yarnpkg.com/@steffo/bluelib-react/-/bluelib-react-4.4.3.tgz#f5b30ba966d25a1757bdddd7d92d9859516fae3f"
integrity sha512-poi6kW7QLNPp/trOV2XXQ6wkYIft5ZG+b2vogFkm36+snPiMOm7nlhaHTqTGyQkJtd3L+DnG/osvDSLJvTlHWQ== integrity sha512-51Iff8SzO+9Lr40jEMXC397uTR1tVKAV6DlFDTKTVDis6zHFAqguifzLJs4xwBxh8JbR7U4juKLSeCCwMS7/lQ==
dependencies: dependencies:
"@babel/runtime" "^7.15.3" "@babel/runtime" "^7.15.3"
classnames "^2.3.1" classnames "^2.3.1"