Skip to content

Commit

Permalink
Async load css
Browse files Browse the repository at this point in the history
  • Loading branch information
drewlyton committed Aug 7, 2023
1 parent 7d1a06a commit 6878f8f
Show file tree
Hide file tree
Showing 2 changed files with 1,115 additions and 3 deletions.
13 changes: 10 additions & 3 deletions app/routes/story/$slug.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import routes from "~/helpers/routes";
import { getMDXComponent } from "mdx-bundler/client";
import { metaTags } from "~/helpers/metaTags";
import prismLine from "~/styles/prism-line-number.css";
import katexCss from "~/styles/katex.css";
import prismTheme from "~/styles/prism-nightowl.css";
import { Subscribe } from "~/components/Subscribe";

Expand Down Expand Up @@ -205,15 +206,21 @@ export function links() {
return [
{
rel: "stylesheet",
href: "https://cdn.jsdelivr.net/npm/katex@0.16.0/dist/katex.min.css"
href: katexCss,
media: "print",
onload: "this.media='all'"
},
{
rel: "stylesheet",
href: prismLine
href: prismLine,
media: "print",
onload: "this.media='all'"
},
{
rel: "stylesheet",
href: prismTheme
href: prismTheme,
media: "print",
onload: "this.media='all'"
}
];
}
Loading

0 comments on commit 6878f8f

Please sign in to comment.