Skip to content

Commit

Permalink
improve first load style
Browse files Browse the repository at this point in the history
  • Loading branch information
naoki-tomita committed Nov 8, 2023
1 parent 5c7ff49 commit 65723ff
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 11 deletions.
3 changes: 3 additions & 0 deletions app/docs/document.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ The default template is as follows.
Props is empty object. Children are your page component will injected.

```tsx
import { h, SsrStyle } from "nzxt/h";

const Document = (_: {}, children: Component[]) => {
return (
<html lang="en">
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
{<SsrStyle /> /* if you want to use zstyl in ssr */}
<title>Document</title>
</head>
<body>
Expand Down
4 changes: 2 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"@types/marked": "^6.0.0",
"@types/node": "^20.8.10",
"marked": "^9.1.4",
"nzxt": "^0.3.11",
"nzxt": "^0.3.12",
"zheleznaya": "^0.2.3",
"zstyl": "^0.2.1"
"zstyl": "^0.2.3"
},
"scripts": {
"build": "nzxt build",
Expand Down
3 changes: 2 additions & 1 deletion app/pages/_document.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { h, Component } from "nzxt/h";
import { h, Component, SsrStyle } from "nzxt/h";

const Document: Component = (_, children) => {
return (
Expand All @@ -11,6 +11,7 @@ const Document: Component = (_, children) => {
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.21.0/components/prism-core.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/prism/1.21.0/plugins/autoloader/prism-autoloader.min.js"></script>
<link rel="shortcut icon" href="/images/favicon.svg" />
{<SsrStyle /> /* if you want to use zstyl in ssr */}
<title>nzxt document</title>
<script async src="https://www.googletagmanager.com/gtag/js?id=G-J0MJBS66XD"></script>
<script>
Expand Down
16 changes: 8 additions & 8 deletions app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,10 @@ ms@2.1.2:
resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009"
integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==

nzxt@^0.3.11:
version "0.3.11"
resolved "https://registry.yarnpkg.com/nzxt/-/nzxt-0.3.11.tgz#aefe965958c545487af5a3d93f4641dd0bac2ae2"
integrity sha512-X9K4l+ynttJgQHB49Q8JyWXI/gdgS3NwVKV/vqZP9SM+6kr8r6vx97WTWx4c4NHUJhENe49g2PnH05rAhbyxHA==
nzxt@^0.3.12:
version "0.3.12"
resolved "https://registry.yarnpkg.com/nzxt/-/nzxt-0.3.12.tgz#69b13185e08c42c80afcd1fe7d09019d6549e386"
integrity sha512-iHNsAk/KXYRVuZQT88FMr4y5IjfyoWC8rqQBt/jJsYQJhZfwXdla1i669al79zv17QHLI0xz29mQQne+DMXqSw==
dependencies:
esbuild "^0.19.5"
esbuild-register "^3.5.0"
Expand Down Expand Up @@ -221,7 +221,7 @@ zheleznaya@^0.2.3:
resolved "https://registry.yarnpkg.com/zheleznaya/-/zheleznaya-0.2.3.tgz#a953b9862f45ca1dc3a6e69ba75250a1e3139ee1"
integrity sha512-Is3bAA5DFxneIfwEErPAipdPWlGzW8cCWRpk+K3Zm0sdzRhK+pAE1GPGhPP+69eIvZN2dwNTtfKTJhanS3mAcA==

zstyl@^0.2.1:
version "0.2.1"
resolved "https://registry.yarnpkg.com/zstyl/-/zstyl-0.2.1.tgz#d881445b70ca5ba2d64e2d3bb0b4439de1b05a0d"
integrity sha512-8xKq1IWH4LEoPiTpqNOESVBaJTGW4+md8fB3exoEpgcQdS5Eh4NI6+E78wv5cPV0IqDERu1+nxtOG622DgyNrg==
zstyl@^0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/zstyl/-/zstyl-0.2.3.tgz#fe7016e16fd067501722022298e815b10cd09797"
integrity sha512-BDt6KS4rmp8ttBqSDPN+buLXYmDP/CYTtpzj9ZX2IiiAAFPb4+VK808DikZOuVN3IqZcAG1mP6TigYUjwvex+g==

0 comments on commit 65723ff

Please sign in to comment.