1
mirror of https://github.com/jakejarvis/jarv.is.git synced 2025-07-17 19:05:32 -04:00

only declare Comic Neue font face on /previously

This commit is contained in:
2022-05-26 09:41:41 -04:00
parent 1e1ecd89ea
commit c2648a0943
6 changed files with 128 additions and 117 deletions

View File

@@ -1,3 +1,5 @@
import type { AtRule } from "@stitches/react/types/css";
// Legacy
import comicNeueLatin400NormalWoff from "@fontsource/comic-neue/files/comic-neue-latin-400-normal.woff";
import comicNeueLatin400NormalWoff2 from "@fontsource/comic-neue/files/comic-neue-latin-400-normal.woff2";
@@ -11,8 +13,7 @@ import comicNeueLatin700ItalicWoff2 from "@fontsource/comic-neue/files/comic-neu
export const name = {
regular: "Comic Neue",
};
export const preloadUrls = [];
export const family = [
export const family: AtRule.FontFace[] = [
{
fontFamily: name.regular,
fontStyle: "normal",

View File

@@ -1,3 +1,5 @@
import type { AtRule } from "@stitches/react/types/css";
// Legacy
import interLatin400NormalWoff from "@fontsource/inter/files/inter-latin-400-normal.woff";
import interLatin400NormalWoff2 from "@fontsource/inter/files/inter-latin-400-normal.woff2";
@@ -15,7 +17,7 @@ export const name = {
};
// re-export hashed URL(s) of the most prominent file so we can preload it in head:
export const preloadUrls = [interLatinVarFullNormalWoff2];
export const family = [
export const family: AtRule.FontFace[] = [
{
fontFamily: name.regular,
fontStyle: "normal",

View File

@@ -1,3 +1,5 @@
import type { AtRule } from "@stitches/react/types/css";
// Legacy
import robotoMonoLatin400NormalWoff from "@fontsource/roboto-mono/files/roboto-mono-latin-400-normal.woff";
import robotoMonoLatin400NormalWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-400-normal.woff2";
@@ -22,7 +24,7 @@ export const name = {
};
// re-export hashed URL(s) of the most prominent file so we can preload it in head:
export const preloadUrls = [robotoMonoLatinVarWghtOnlyNormalWoff2];
export const family = [
export const family: AtRule.FontFace[] = [
{
fontFamily: name.regular,
fontStyle: "normal",

View File

@@ -8,7 +8,7 @@ import normalizeCss from "stitches-normalize";
import hexToRgba from "hex-to-rgba";
// web fonts
import { Inter, RobotoMono, ComicNeue } from "./fonts";
import { Inter, RobotoMono } from "./fonts";
export const { styled, css, getCssText, globalCss, keyframes, createTheme, theme } = createStitches({
theme: {
@@ -119,7 +119,7 @@ export const globalStyles = globalCss(
// @ts-ignore
...normalizeCss({ systemFonts: false }),
{
"@font-face": [...Inter.family, ...RobotoMono.family, ...ComicNeue.family],
"@font-face": [...Inter.family, ...RobotoMono.family],
body: {
backgroundColor: "$backgroundInner",
@@ -161,4 +161,4 @@ export const globalStyles = globalCss(
);
// re-export hashed URLs of the most important variable fonts so we can preload them in pages/_document.tsx
export const preloadUrls = [...Inter.preloadUrls, ...RobotoMono.preloadUrls, ...ComicNeue.preloadUrls];
export const preloadUrls = [...Inter.preloadUrls, ...RobotoMono.preloadUrls];