fix: noscript message css, remove woff from build

This commit is contained in:
David Ralph 2021-07-11 15:08:35 +01:00
parent 70fc204e70
commit 401baa6653
3 changed files with 29 additions and 13 deletions

View File

@ -11,21 +11,17 @@
<body>
<noscript>
<style>
@font-face {
font-family: 'Lexend Deca';
src: url('./static/media/lexend-deca-latin-400-normal.35a9aeba.woff2');
}
*, a {
font-family: 'Lexend Deca', sans-serif;
text-align: center;
color: black;
background: white !important;
}
@media (prefers-color-scheme: dark) {
*, a {
color: white;
background: #2f3640;
background: #2f3640 !important;
}
}
</style>

View File

@ -8,8 +8,6 @@ import './scss/index.scss';
// the toast css is based on default so we need to import it
import 'react-toastify/dist/ReactToastify.min.css';
import '@fontsource/lexend-deca/400.css';
// this is opt-in btw, allows you to see your stats etc
import Stats from './modules/helpers/stats';
@ -25,11 +23,6 @@ if (languagecode === 'en') {
window.languagecode = 'en_GB';
}
// only load font if needed
if (languagecode === 'ru') {
require('@fontsource/montserrat/cyrillic-500.css');
}
// these are merged so if a string is untranslated it doesn't break mue
window.language = merge(require('./translations/en_GB.json'), require(`./translations/${window.languagecode}.json`));

View File

@ -48,3 +48,30 @@ body {
display: grid;
color: map-get($theme-colours, 'main-text-color');
}
// fonts imported from fontsource
@font-face {
font-family: 'Lexend Deca';
font-style: normal;
font-display: swap;
font-weight: 400;
src: url('../../node_modules/@fontsource/lexend-deca/files/lexend-deca-latin-400-normal.woff2') format('woff2');
}
@font-face {
font-family: 'Lexend Deca';
font-style: normal;
font-display: swap;
font-weight: 400;
src: url('../../node_modules/@fontsource/lexend-deca/files/lexend-deca-latin-ext-400-normal.woff2') format('woff2');
unicode-range: U+0100-024F, U+0259, U+1E00-1EFF, U+2020, U+20A0-20AB, U+20AD-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
font-family: 'Montserrat';
font-style: normal;
font-display: swap;
font-weight: 400;
src: url('../../node_modules/@fontsource/montserrat/files/montserrat-cyrillic-400-normal.woff2') format('woff2');
unicode-range: U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}