diff options
| author | eug-vs <eugene@eug-vs.xyz> | 2022-10-22 23:51:41 +0300 | 
|---|---|---|
| committer | eug-vs <eugene@eug-vs.xyz> | 2022-10-22 23:51:41 +0300 | 
| commit | 97b05f5579e863e3b6a03d3113236f64fe489583 (patch) | |
| tree | 03f4fef07cf47c2b8531714b3e643ff9e04cf3c1 | |
| parent | 0ed6bf41be126e8a4f274de06545dbf4f3f883c2 (diff) | |
| download | benzin-next-97b05f5579e863e3b6a03d3113236f64fe489583.tar.gz | |
feat: use external stylesheet
| -rw-r--r-- | src/benzinConfig.ts | 3 | ||||
| -rw-r--r-- | src/lib/types.ts | 1 | ||||
| -rw-r--r-- | src/pages/_app.tsx | 1 | ||||
| -rw-r--r-- | src/pages/_document.tsx | 16 | ||||
| -rw-r--r-- | src/styles/globals.css | 121 | 
5 files changed, 19 insertions, 123 deletions
| diff --git a/src/benzinConfig.ts b/src/benzinConfig.ts index 8d58950..12cdada 100644 --- a/src/benzinConfig.ts +++ b/src/benzinConfig.ts @@ -6,7 +6,8 @@ const benzinConfig: BenzinConfig = {    CDN: 'https://git.eug-vs.xyz/eug-vs/eug-vs-xyz/plain/src',    adapter: nginxAdapter,    faviconPath: '/public/icon-64.png', -  emojiRootPath: 'emoji', +  emojiRootPath: '/emoji', +  cssPath: '/public/style.css?h=benzin-next-cdn'  };  export default benzinConfig; diff --git a/src/lib/types.ts b/src/lib/types.ts index 2070e0b..a177dcd 100644 --- a/src/lib/types.ts +++ b/src/lib/types.ts @@ -13,4 +13,5 @@ export interface BenzinConfig {    title: string;    faviconPath: string;    emojiRootPath: string; +  cssPath: string;  } diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index 18692df..3dd15a2 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,4 +1,3 @@ -import '../styles/globals.css';  import logo from '../../public/eug-vs.png';  import type { AppProps } from 'next/app';  import Image from 'next/future/image'; diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx new file mode 100644 index 0000000..c783ad4 --- /dev/null +++ b/src/pages/_document.tsx @@ -0,0 +1,16 @@ +import { Html, Head, Main, NextScript } from 'next/document' +import benzinConfig from '../benzinConfig' + +export default function Document() { +  return ( +    <Html> +      <Head> +        <link rel="stylesheet" href={`${benzinConfig.CDN}${benzinConfig.cssPath}`} type="text/css" /> +      </Head> +      <body> +        <Main /> +        <NextScript /> +      </body> +    </Html> +  ) +} diff --git a/src/styles/globals.css b/src/styles/globals.css deleted file mode 100644 index 758775e..0000000 --- a/src/styles/globals.css +++ /dev/null @@ -1,121 +0,0 @@ -@font-face { -  font-family: "Bitter"; -  src: url(../../public/fonts/Bitter-Regular.woff) format("truetype"); -} -html { -  font-family: "Open Sans", sans-serif; -  color: #ebdbb2; -  background-color: #282828; -} -body { -  margin: 0 auto; -  max-width: 1100px; -  padding-left: 50px; -  padding-right: 50px; -  padding-top: 50px; -  padding-bottom: 50px; -  word-wrap: break-word; -  text-rendering: optimizeLegibility; -  font-kerning: normal; -  font-size: 16px; -} -@media (max-width: 600px) { -  body { -    padding: 1em; -  } -} -p { -  margin: 1em 0; -} -a { -  color: #fabd2f; -  text-decoration: none; -} -a:hover { -  text-decoration: underline; -} -img { -  max-width: 100%; -} -h1 { -  font-weight: normal; -} -h2, h3, h4, h5, h6 { -  font-family: "Bitter", serif; -  font-weight: normal; -  line-height: 1.1; -  margin-top: 1.4em; -} -h2 { -  border-bottom: 1px solid rgba(255, 255, 255, 0.12); -} -h3 { -  font-size: 21px; -} -ol, ul { -  padding-left: 1.7em; -  margin-top: 1em; -} -li > ol, li > ul { -  margin-top: 0; -} -blockquote { -  margin: 1em 0 1em 1.7em; -  padding-left: 1em; -  border-left: 2px solid #e6e6e6; -  color: rgba(255, 255, 255, 0.75); -  font-style: italic; -} -code:not(pre code) { -  font-family: monospace; -  font-size: 90%; -  margin: 0; -  padding: 2px; -  background: #1d2021; -  border-radius: 4px; -  border: 1px solid rgba(255, 255, 255, 0.12); -} -pre div { -  border-radius: 4px; -  border: 1px solid rgba(255, 255, 255, 0.12); -  background-color: #1d2021 !important; -} -hr { -  background-color: #1a1a1a; -  border: none; -  height: 1px; -  margin: 1em 0; -} -table { -  margin: 1em 0; -  border-collapse: collapse; -  width: 100%; -  overflow-x: auto; -  display: block; -  font-variant-numeric: lining-nums tabular-nums; -} -table caption { -  margin-bottom: 0.75em; -} -tbody { -  margin-top: 0.5em; -  border-top: 1px solid #1a1a1a; -  border-bottom: 1px solid #1a1a1a; -} -th { -  border-top: 1px solid #1a1a1a; -  padding: 0.25em 0.5em 0.25em 0.5em; -} -td { -  padding: 0.125em 0.5em 0.25em 0.5em; -} -header { -  margin-bottom: 4em; -  text-align: center; -} -#TOC li { -  list-style: none; -} -#TOC a:not(:hover) { -  text-decoration: none; -} | 
