fix lightning font loading

This commit is contained in:
keyan 2022-02-23 21:02:23 -06:00
parent 8e857fd8a7
commit 6ec1aa1a1f
2 changed files with 11 additions and 6 deletions

View File

@ -1,11 +1,21 @@
import Document, { Html, Head, Main, NextScript } from 'next/document' import Document, { Html, Head, Main, NextScript } from 'next/document'
const publicPrefix = process.env.NODE_ENV === 'development' ? '' : 'https://a.stacker.news'
class MyDocument extends Document { class MyDocument extends Document {
render () { render () {
return ( return (
<Html> <Html>
<Head> <Head>
<link rel='preload' href='/Lightningvolt-xoqm.ttf' as='font' type='font/ttf' crossOrigin='' /> <link rel='preload' href={`${publicPrefix}/Lightningvolt-xoqm.ttf`} as='font' type='font/ttf' crossOrigin='' />
<style
dangerouslySetInnerHTML={{
__html:
` @font-face {
font-family: lightning;
src: url(${publicPrefix}/Lightningvolt-xoqm.ttf);
}`
}}
/>
</Head> </Head>
<body> <body>
<script src='/darkmode.js' /> <script src='/darkmode.js' />

View File

@ -53,11 +53,6 @@ $tooltip-bg: #5c8001;
@import "~bootstrap/scss/bootstrap"; @import "~bootstrap/scss/bootstrap";
@font-face {
font-family: lightning;
src: url(/Lightningvolt-xoqm.ttf);
}
@media screen and (min-width: 767px) { @media screen and (min-width: 767px) {
.table-sm th, .table-sm td { .table-sm th, .table-sm td {
padding: .3rem .75rem; padding: .3rem .75rem;