fix: correctly embed styles.css

This commit is contained in:
Max Richter
2025-11-03 00:46:49 +01:00
parent 696082250d
commit ebb897dca4
4 changed files with 47 additions and 37 deletions

View File

@@ -1,11 +1,9 @@
// deno-lint-ignore-file react-no-danger
import { PageProps } from "$fresh/server.ts";
import { Partial } from "$fresh/runtime.ts";
import { useEffect } from "preact/hooks";
export default function App({ Component }: PageProps) {
const globalCss = Deno
.readTextFileSync("./static/global.css")
.replaceAll("\n", "");
const globalCss = Deno.readTextFileSync("./static/global.css");
return (
<html>
@@ -21,7 +19,19 @@ export default function App({ Component }: PageProps) {
<meta name="msapplication-TileColor" content="#da532c" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#141218" />
<style>{globalCss}</style>
<link
rel="preload"
href="/fonts/work-sans-v18-latin-regular.woff2"
as="font"
type="font/woff2"
/>
<link
rel="preload"
href="/fonts/work-sans-v18-latin-700.woff2"
as="font"
type="font/woff2"
/>
<style dangerouslySetInnerHTML={{ __html: globalCss }} />
<title>Memorium</title>
</head>
<body f-client-nav>

View File

@@ -23,10 +23,7 @@ export default function MyLayout({ Component }: PageProps) {
})}
</nav>
</aside>
<main
class="py-5"
style={{ fontFamily: "Work Sans" }}
>
<main class="py-5">
<Component />
</main>
</div>