feat: add css

This commit is contained in:
Julien Oculi 2024-01-23 14:43:22 +01:00
parent 9b3b209874
commit 910ae2ba2e
3 changed files with 37 additions and 1 deletions

View file

@ -1,6 +1,6 @@
{ {
"tasks": { "tasks": {
"serve": "deno run --allow-env --allow-read --allow-write --allow-net --watch=./client,./script.tsx ./server.tsx" "serve": "deno run --allow-env --allow-read --allow-write --allow-net --watch=./client,./script.tsx,./style.css ./server.tsx"
}, },
"fmt": { "fmt": {
"singleQuote": true, "singleQuote": true,

View file

@ -13,6 +13,8 @@ const script = await bundle('./script.tsx', {
'importMap': { imports: denoConfig.imports }, 'importMap': { imports: denoConfig.imports },
}) })
const css = await Deno.readTextFile('./style.css')
/** /**
* Page template * Page template
*/ */
@ -22,6 +24,7 @@ function Template() {
<head> <head>
<title>Démo</title> <title>Démo</title>
</head> </head>
<style>{css}</style>
<body> <body>
</body> </body>
<script type='module' dangerouslySetInnerHTML={{ __html: script.code }}> <script type='module' dangerouslySetInnerHTML={{ __html: script.code }}>

33
style.css Normal file
View file

@ -0,0 +1,33 @@
html {
scroll-behavior: smooth;
box-sizing: border-box;
}
body {
padding: 0;
margin: 0;
font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI',
Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue',
sans-serif;
display: block;
}
main {
height: 100dvh;
display: flex;
flex-direction: row;
}
h1 {
text-align: center;
margin: 0;
padding: 1rem;
color: white;
background-color: #97c2fc;
box-shadow: 0 0 0.4rem 0.2rem rgba(0, 0, 0, 0.2);
}
.graph {
width: 100%;
height: 100%;
}