From 0c017f01608502ef827bb6e88a50603830dd1a10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Garapich?= Date: Sun, 22 Dec 2024 01:26:30 +0100 Subject: [PATCH] feat: embed main.css (#121) --- src/html/layout.tsx | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/html/layout.tsx b/src/html/layout.tsx index 814313c7..0d5c1a76 100644 --- a/src/html/layout.tsx +++ b/src/html/layout.tsx @@ -2,14 +2,11 @@ import { environment } from '../environment' import { ReadyUpDialog } from '../queue/views/html/ready-up-dialog' import Html from '@kitajs/html' import { FlashMessages } from './components/flash-messages' -import { bundle } from './bundle' import { resolve } from 'path' import { requestContext } from '@fastify/request-context' import { embed } from './embed' -const mainCss = await bundle(resolve(import.meta.dirname, 'styles', 'main.css')) - -export function Layout( +export async function Layout( props?: Html.PropsWithChildren<{ title?: string embedStyle?: string @@ -38,6 +35,8 @@ export function Layout( ) } + const safeCss = await embed(resolve(import.meta.dirname, 'styles', 'main.css')) + return ( <> @@ -46,7 +45,7 @@ export function Layout( - + {title}