Website for showcasing all features of Tesseract Web.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

49 行
1.2 KiB

  1. import NextDocument, {Html, Head as NextHead, Main, NextScript, DocumentContext} from 'next/document';
  2. import * as goober from 'goober';
  3. export default class Document extends NextDocument {
  4. static async getInitialProps(ctx: DocumentContext) {
  5. const page = await ctx.renderPage()
  6. const style = goober.extractCss();
  7. const initialProps = await NextDocument.getInitialProps(ctx)
  8. return {
  9. ...initialProps,
  10. ...page,
  11. style,
  12. }
  13. }
  14. render() {
  15. const { style: rawStyle } = this.props as Record<string, unknown>
  16. const style = rawStyle as string
  17. return (
  18. <Html>
  19. <NextHead
  20. className="container mx-auto px-4 block mt-16 md:mt-32"
  21. >
  22. <link rel="stylesheet" href="/tailwind-utilities.css" />
  23. <link rel="stylesheet" href="/global.css" />
  24. <link rel="stylesheet" href="/theme.css" />
  25. <link rel="stylesheet" href="/theme/dark.css" />
  26. {
  27. style.length > 0
  28. && (
  29. <style
  30. id="_goober_ssr"
  31. dangerouslySetInnerHTML={{ __html: style }}
  32. />
  33. )
  34. }
  35. </NextHead>
  36. <body>
  37. <Main />
  38. <NextScript />
  39. </body>
  40. </Html>
  41. )
  42. }
  43. }