Skip to content

Commit

Permalink
Remove JS preloading of fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
ahosgood committed Oct 18, 2023
1 parent 8f48d26 commit 11a4b75
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions .storybook/preview.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import "../src/nationalarchives/all.scss";
import { a11yConfig } from "./storybook-config";
import { customViewports } from "./viewports";
import isChromatic from "chromatic/isChromatic";
// import isChromatic from "chromatic/isChromatic";

document.documentElement.classList.add("tna-template");
if (window.self !== window.top) {
Expand Down Expand Up @@ -30,12 +30,12 @@ export const parameters = {
},
};

const fontLoader = async () => ({
fonts: await Promise.all([
document.fonts.load("normal 1em Open Sans"),
document.fonts.load("bold 1em Open Sans"),
document.fonts.load("normal 1em Roboto Mono"),
]),
});
// const fontLoader = async () => ({
// fonts: await Promise.all([
// document.fonts.load("normal 1em Open Sans"),
// document.fonts.load("bold 1em Open Sans"),
// document.fonts.load("normal 1em Roboto Mono"),
// ]),
// });

export const loaders = isChromatic() && document.fonts ? [fontLoader] : [];
// export const loaders = isChromatic() && document.fonts ? [fontLoader] : [];

0 comments on commit 11a4b75

Please sign in to comment.