mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-07-21 19:35:59 -04:00
just some refactoring
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Feed } from "feed";
|
||||
import { getAllNotes } from "./parse-notes";
|
||||
import * as config from "./config";
|
||||
import * as config from "../config";
|
||||
import type { GetServerSidePropsContext, PreviewData } from "next";
|
||||
import type { ParsedUrlQuery } from "querystring";
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
// Bundle these components by default:
|
||||
export { default as Image } from "../../components/Image/Image";
|
||||
export { default as Figure } from "../../components/Figure/Figure";
|
||||
|
||||
// These (mostly very small) components are direct replacements for HTML tags generated by remark:
|
||||
export { default as a } from "../../components/Link/Link";
|
||||
export { default as code } from "../../components/CodeBlock/CodeBlock";
|
||||
export { default as blockquote } from "../../components/Blockquote/Blockquote";
|
||||
export { default as hr } from "../../components/HorizontalRule/HorizontalRule";
|
||||
export { H1 as h1, H2 as h2, H3 as h3, H4 as h4, H5 as h5, H6 as h6 } from "../../components/Heading/Heading";
|
||||
export { UnorderedList as ul, OrderedList as ol, ListItem as li } from "../../components/List/List";
|
||||
|
||||
// ...and these components are technically passed into all posts, but next/dynamic ensures they're loaded only
|
||||
// when they're referenced in the individual mdx files.
|
||||
export const IFrame = dynamic(() => import("../../components/IFrame/IFrame"));
|
||||
export const Video = dynamic(() => import("../../components/Video/Video"));
|
||||
export const YouTube = dynamic(() => import("../../components/YouTubeEmbed/YouTubeEmbed"));
|
||||
export const Tweet = dynamic(() => import("../../components/TweetEmbed/TweetEmbed"));
|
||||
export const Gist = dynamic(() => import("../../components/GistEmbed/GistEmbed"));
|
||||
|
||||
// One-offs for specific posts:
|
||||
export const OctocatLink = dynamic(() => import("../../components/OctocatLink/OctocatLink"));
|
||||
@@ -8,8 +8,8 @@ import { compiler } from "markdown-to-jsx";
|
||||
import removeMarkdown from "remove-markdown";
|
||||
import sanitizeHtml from "sanitize-html";
|
||||
import readingTime from "reading-time";
|
||||
import { baseUrl } from "./config";
|
||||
import { NOTES_DIR } from "./config/constants";
|
||||
import { baseUrl } from "../config";
|
||||
import { NOTES_DIR } from "../config/constants";
|
||||
|
||||
// remark/rehype markdown plugins
|
||||
import remarkGfm from "remark-gfm";
|
||||
@@ -17,7 +17,7 @@ import rehypeSlug from "rehype-slug";
|
||||
import rehypePrism from "rehype-prism-plus";
|
||||
|
||||
import type { MinifyOptions } from "terser";
|
||||
import type { NoteType } from "../types";
|
||||
import type { NoteType } from "../../types";
|
||||
|
||||
// returns all .mdx files in NOTES_DIR (without .mdx extension)
|
||||
export const getNoteSlugs = () =>
|
||||
@@ -1,24 +0,0 @@
|
||||
import dynamic from "next/dynamic";
|
||||
|
||||
// Bundle these components by default:
|
||||
export { default as Image } from "../components/Image/Image";
|
||||
export { default as Figure } from "../components/Figure/Figure";
|
||||
|
||||
// These (mostly very small) components are direct replacements for HTML tags generated by remark:
|
||||
export { default as a } from "../components/Link/Link";
|
||||
export { default as code } from "../components/CodeBlock/CodeBlock";
|
||||
export { default as blockquote } from "../components/Blockquote/Blockquote";
|
||||
export { default as hr } from "../components/HorizontalRule/HorizontalRule";
|
||||
export { H1 as h1, H2 as h2, H3 as h3, H4 as h4, H5 as h5, H6 as h6 } from "../components/Heading/Heading";
|
||||
export { UnorderedList as ul, OrderedList as ol, ListItem as li } from "../components/List/List";
|
||||
|
||||
// ...and these components are technically passed into all posts, but next/dynamic ensures they're loaded only
|
||||
// when they're referenced in the individual mdx files.
|
||||
export const IFrame = dynamic(() => import("../components/IFrame/IFrame"));
|
||||
export const Video = dynamic(() => import("../components/Video/Video"));
|
||||
export const YouTube = dynamic(() => import("../components/YouTubeEmbed/YouTubeEmbed"));
|
||||
export const Tweet = dynamic(() => import("../components/TweetEmbed/TweetEmbed"));
|
||||
export const Gist = dynamic(() => import("../components/GistEmbed/GistEmbed"));
|
||||
|
||||
// One-offs for specific posts:
|
||||
export const OctocatLink = dynamic(() => import("../components/OctocatLink/OctocatLink"));
|
||||
@@ -1,29 +0,0 @@
|
||||
// @ts-nocheck
|
||||
|
||||
// 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";
|
||||
import comicNeueLatin700NormalWoff from "@fontsource/comic-neue/files/comic-neue-latin-700-normal.woff";
|
||||
import comicNeueLatin700NormalWoff2 from "@fontsource/comic-neue/files/comic-neue-latin-700-normal.woff2";
|
||||
|
||||
const ComicNeue = {
|
||||
preloadUrl: null, // don't preload, only used on one page
|
||||
family: [
|
||||
{
|
||||
fontFamily: "Comic Neue",
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 400,
|
||||
src: `url(${comicNeueLatin400NormalWoff2}) format("woff2"), url(${comicNeueLatin400NormalWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: "Comic Neue",
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 700,
|
||||
src: `url(${comicNeueLatin700NormalWoff2}) format("woff2"), url(${comicNeueLatin700NormalWoff}) format("woff")`,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default ComicNeue;
|
||||
@@ -1,49 +0,0 @@
|
||||
// @ts-nocheck
|
||||
|
||||
// Legacy
|
||||
import interLatin400NormalWoff from "@fontsource/inter/files/inter-latin-400-normal.woff";
|
||||
import interLatin400NormalWoff2 from "@fontsource/inter/files/inter-latin-400-normal.woff2";
|
||||
import interLatin500NormalWoff from "@fontsource/inter/files/inter-latin-500-normal.woff";
|
||||
import interLatin500NormalWoff2 from "@fontsource/inter/files/inter-latin-500-normal.woff2";
|
||||
import interLatin700NormalWoff from "@fontsource/inter/files/inter-latin-700-normal.woff";
|
||||
import interLatin700NormalWoff2 from "@fontsource/inter/files/inter-latin-700-normal.woff2";
|
||||
|
||||
// Variable
|
||||
import interLatinVarFullNormalWoff2 from "@fontsource/inter/files/inter-latin-variable-full-normal.woff2";
|
||||
|
||||
const Inter = {
|
||||
// re-export hashed URL of the most prominent file so we can preload it in head:
|
||||
preloadUrl: interLatinVarFullNormalWoff2,
|
||||
family: [
|
||||
{
|
||||
fontFamily: "Inter",
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 400,
|
||||
src: `url(${interLatin400NormalWoff2}) format("woff2"), url(${interLatin400NormalWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: "Inter",
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 500,
|
||||
src: `url(${interLatin500NormalWoff2}) format("woff2"), url(${interLatin500NormalWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: "Inter",
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 700,
|
||||
src: `url(${interLatin700NormalWoff2}) format("woff2"), url(${interLatin700NormalWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: "Inter var",
|
||||
fontStyle: "oblique 0deg 10deg",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: "100 900",
|
||||
src: `url(${interLatinVarFullNormalWoff2}) format("woff2")`,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default Inter;
|
||||
@@ -1,84 +0,0 @@
|
||||
// @ts-nocheck
|
||||
|
||||
// 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";
|
||||
import robotoMonoLatin500NormalWoff from "@fontsource/roboto-mono/files/roboto-mono-latin-500-normal.woff";
|
||||
import robotoMonoLatin500NormalWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-500-normal.woff2";
|
||||
import robotoMonoLatin700NormalWoff from "@fontsource/roboto-mono/files/roboto-mono-latin-700-normal.woff";
|
||||
import robotoMonoLatin700NormalWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-700-normal.woff2";
|
||||
import robotoMonoLatin400ItalicWoff from "@fontsource/roboto-mono/files/roboto-mono-latin-400-italic.woff";
|
||||
import robotoMonoLatin400ItalicWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-400-italic.woff2";
|
||||
import robotoMonoLatin500ItalicWoff from "@fontsource/roboto-mono/files/roboto-mono-latin-500-italic.woff";
|
||||
import robotoMonoLatin500ItalicWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-500-italic.woff2";
|
||||
import robotoMonoLatin700ItalicWoff from "@fontsource/roboto-mono/files/roboto-mono-latin-700-italic.woff";
|
||||
import robotoMonoLatin700ItalicWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-700-italic.woff2";
|
||||
|
||||
// Variable
|
||||
import robotoMonoLatinVarWghtOnlyNormalWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-variable-wghtOnly-normal.woff2";
|
||||
import robotoMonoLatinVarWghtOnlyItalicWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-variable-wghtOnly-italic.woff2";
|
||||
|
||||
const RobotoMono = {
|
||||
// re-export hashed URL of the most prominent file so we can preload it in head:
|
||||
preloadUrl: robotoMonoLatinVarWghtOnlyNormalWoff2,
|
||||
family: [
|
||||
{
|
||||
fontFamily: "Roboto Mono",
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 400,
|
||||
src: `url(${robotoMonoLatin400NormalWoff2}) format("woff2"), url(${robotoMonoLatin400NormalWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: "Roboto Mono",
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 500,
|
||||
src: `url(${robotoMonoLatin500NormalWoff2}) format("woff2"), url(${robotoMonoLatin500NormalWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: "Roboto Mono",
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 700,
|
||||
src: `url(${robotoMonoLatin700NormalWoff2}) format("woff2"), url(${robotoMonoLatin700NormalWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: "Roboto Mono",
|
||||
fontStyle: "italic",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 400,
|
||||
src: `url(${robotoMonoLatin400ItalicWoff2}) format("woff2"), url(${robotoMonoLatin400ItalicWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: "Roboto Mono",
|
||||
fontStyle: "italic",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 500,
|
||||
src: `url(${robotoMonoLatin500ItalicWoff2}) format("woff2"), url(${robotoMonoLatin500ItalicWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: "Roboto Mono",
|
||||
fontStyle: "italic",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 700,
|
||||
src: `url(${robotoMonoLatin700ItalicWoff2}) format("woff2"), url(${robotoMonoLatin700ItalicWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: "Roboto Mono var",
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: "100 700",
|
||||
src: `url(${robotoMonoLatinVarWghtOnlyNormalWoff2}) format("woff2")`,
|
||||
},
|
||||
{
|
||||
fontFamily: "Roboto Mono var",
|
||||
fontStyle: "italic",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: "100 700",
|
||||
src: `url(${robotoMonoLatinVarWghtOnlyItalicWoff2}) format("woff2")`,
|
||||
},
|
||||
],
|
||||
};
|
||||
|
||||
export default RobotoMono;
|
||||
@@ -0,0 +1,27 @@
|
||||
// @ts-nocheck
|
||||
|
||||
// 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";
|
||||
import comicNeueLatin700NormalWoff from "@fontsource/comic-neue/files/comic-neue-latin-700-normal.woff";
|
||||
import comicNeueLatin700NormalWoff2 from "@fontsource/comic-neue/files/comic-neue-latin-700-normal.woff2";
|
||||
|
||||
export const name = {
|
||||
regular: "Comic Neue",
|
||||
};
|
||||
export const family = [
|
||||
{
|
||||
fontFamily: name.regular,
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 400,
|
||||
src: `url(${comicNeueLatin400NormalWoff2}) format("woff2"), url(${comicNeueLatin400NormalWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: name.regular,
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 700,
|
||||
src: `url(${comicNeueLatin700NormalWoff2}) format("woff2"), url(${comicNeueLatin700NormalWoff}) format("woff")`,
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,49 @@
|
||||
// @ts-nocheck
|
||||
|
||||
// Legacy
|
||||
import interLatin400NormalWoff from "@fontsource/inter/files/inter-latin-400-normal.woff";
|
||||
import interLatin400NormalWoff2 from "@fontsource/inter/files/inter-latin-400-normal.woff2";
|
||||
import interLatin500NormalWoff from "@fontsource/inter/files/inter-latin-500-normal.woff";
|
||||
import interLatin500NormalWoff2 from "@fontsource/inter/files/inter-latin-500-normal.woff2";
|
||||
import interLatin700NormalWoff from "@fontsource/inter/files/inter-latin-700-normal.woff";
|
||||
import interLatin700NormalWoff2 from "@fontsource/inter/files/inter-latin-700-normal.woff2";
|
||||
|
||||
// Variable
|
||||
import interLatinVarFullNormalWoff2 from "@fontsource/inter/files/inter-latin-variable-full-normal.woff2";
|
||||
|
||||
export const name = {
|
||||
regular: "Inter",
|
||||
variable: "Inter var",
|
||||
};
|
||||
// re-export hashed URL(s) of the most prominent file so we can preload it in head:
|
||||
export const preloadUrls = [interLatinVarFullNormalWoff2];
|
||||
export const family = [
|
||||
{
|
||||
fontFamily: name.regular,
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 400,
|
||||
src: `url(${interLatin400NormalWoff2}) format("woff2"), url(${interLatin400NormalWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: name.regular,
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 500,
|
||||
src: `url(${interLatin500NormalWoff2}) format("woff2"), url(${interLatin500NormalWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: name.regular,
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 700,
|
||||
src: `url(${interLatin700NormalWoff2}) format("woff2"), url(${interLatin700NormalWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: name.variable,
|
||||
fontStyle: "oblique 0deg 10deg",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: "100 900",
|
||||
src: `url(${interLatinVarFullNormalWoff2}) format("woff2")`,
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,84 @@
|
||||
// @ts-nocheck
|
||||
|
||||
// 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";
|
||||
import robotoMonoLatin500NormalWoff from "@fontsource/roboto-mono/files/roboto-mono-latin-500-normal.woff";
|
||||
import robotoMonoLatin500NormalWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-500-normal.woff2";
|
||||
import robotoMonoLatin700NormalWoff from "@fontsource/roboto-mono/files/roboto-mono-latin-700-normal.woff";
|
||||
import robotoMonoLatin700NormalWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-700-normal.woff2";
|
||||
import robotoMonoLatin400ItalicWoff from "@fontsource/roboto-mono/files/roboto-mono-latin-400-italic.woff";
|
||||
import robotoMonoLatin400ItalicWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-400-italic.woff2";
|
||||
import robotoMonoLatin500ItalicWoff from "@fontsource/roboto-mono/files/roboto-mono-latin-500-italic.woff";
|
||||
import robotoMonoLatin500ItalicWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-500-italic.woff2";
|
||||
import robotoMonoLatin700ItalicWoff from "@fontsource/roboto-mono/files/roboto-mono-latin-700-italic.woff";
|
||||
import robotoMonoLatin700ItalicWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-700-italic.woff2";
|
||||
|
||||
// Variable
|
||||
import robotoMonoLatinVarWghtOnlyNormalWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-variable-wghtOnly-normal.woff2";
|
||||
import robotoMonoLatinVarWghtOnlyItalicWoff2 from "@fontsource/roboto-mono/files/roboto-mono-latin-variable-wghtOnly-italic.woff2";
|
||||
|
||||
export const name = {
|
||||
regular: "Roboto Mono",
|
||||
variable: "Roboto Mono var",
|
||||
};
|
||||
// re-export hashed URL(s) of the most prominent file so we can preload it in head:
|
||||
export const preloadUrls = [robotoMonoLatinVarWghtOnlyNormalWoff2];
|
||||
export const family = [
|
||||
{
|
||||
fontFamily: name.regular,
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 400,
|
||||
src: `url(${robotoMonoLatin400NormalWoff2}) format("woff2"), url(${robotoMonoLatin400NormalWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: name.regular,
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 500,
|
||||
src: `url(${robotoMonoLatin500NormalWoff2}) format("woff2"), url(${robotoMonoLatin500NormalWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: name.regular,
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 700,
|
||||
src: `url(${robotoMonoLatin700NormalWoff2}) format("woff2"), url(${robotoMonoLatin700NormalWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: name.regular,
|
||||
fontStyle: "italic",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 400,
|
||||
src: `url(${robotoMonoLatin400ItalicWoff2}) format("woff2"), url(${robotoMonoLatin400ItalicWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: name.regular,
|
||||
fontStyle: "italic",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 500,
|
||||
src: `url(${robotoMonoLatin500ItalicWoff2}) format("woff2"), url(${robotoMonoLatin500ItalicWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: name.regular,
|
||||
fontStyle: "italic",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: 700,
|
||||
src: `url(${robotoMonoLatin700ItalicWoff2}) format("woff2"), url(${robotoMonoLatin700ItalicWoff}) format("woff")`,
|
||||
},
|
||||
{
|
||||
fontFamily: name.variable,
|
||||
fontStyle: "normal",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: "100 700",
|
||||
src: `url(${robotoMonoLatinVarWghtOnlyNormalWoff2}) format("woff2")`,
|
||||
},
|
||||
{
|
||||
fontFamily: name.variable,
|
||||
fontStyle: "italic",
|
||||
fontDisplay: "swap",
|
||||
fontWeight: "100 700",
|
||||
src: `url(${robotoMonoLatinVarWghtOnlyItalicWoff2}) format("woff2")`,
|
||||
},
|
||||
];
|
||||
@@ -0,0 +1,9 @@
|
||||
import * as Inter from "./fonts/inter";
|
||||
import * as RobotoMono from "./fonts/roboto-mono";
|
||||
import * as ComicNeue from "./fonts/comic-neue";
|
||||
|
||||
// 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];
|
||||
|
||||
// re-export everything for use in ../stitches.config.ts
|
||||
export { Inter, RobotoMono, ComicNeue };
|
||||
@@ -1,22 +1,22 @@
|
||||
import { createStitches, defaultThemeMap } from "@stitches/react";
|
||||
import hex2rgba from "./helpers/hex-to-rgba";
|
||||
|
||||
// modified modern-normalize.css in object form:
|
||||
// https://github.com/jakejarvis/stitches-normalize/blob/main/index.js
|
||||
import normalizeCss from "stitches-normalize";
|
||||
|
||||
// web fonts
|
||||
import Inter from "./fonts/inter";
|
||||
import RobotoMono from "./fonts/roboto-mono";
|
||||
import ComicNeue from "./fonts/comic-neue";
|
||||
import { Inter, RobotoMono, ComicNeue } from "./helpers/typography";
|
||||
|
||||
// misc. helpers
|
||||
import hex2rgba from "./helpers/hex-to-rgba";
|
||||
|
||||
export const { styled, css, getCssText, globalCss, keyframes, createTheme, theme } = createStitches({
|
||||
theme: {
|
||||
fonts: {
|
||||
sans: `Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,
|
||||
sansVar: `"Inter var", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,
|
||||
mono: `"Roboto Mono", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier`,
|
||||
monoVar: `"Roboto Mono var", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier`,
|
||||
sans: `"${Inter.name.regular}", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,
|
||||
sansVar: `"${Inter.name.variable}", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif`,
|
||||
mono: `"${RobotoMono.name.regular}", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier`,
|
||||
monoVar: `"${RobotoMono.name.variable}", ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier`,
|
||||
},
|
||||
|
||||
colors: {
|
||||
@@ -160,10 +160,5 @@ 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 = {
|
||||
fonts: {
|
||||
InterVar: Inter.preloadUrl,
|
||||
RobotoMonoVar: RobotoMono.preloadUrl,
|
||||
},
|
||||
};
|
||||
// re-export all font data so we can do things like preloading them in pages/_document.tsx
|
||||
export * as fonts from "./helpers/typography";
|
||||
|
||||
Reference in New Issue
Block a user