Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a3c4586 commit ae40f8aCopy full SHA for ae40f8a
site/.storybook/preview.jsx
@@ -11,6 +11,7 @@ import { QueryClient, QueryClientProvider } from "react-query";
11
import { HelmetProvider } from "react-helmet-async";
12
import themes from "theme";
13
import "theme/globalFonts";
14
+import isChromatic from "chromatic/isChromatic";
15
16
DecoratorHelpers.initializeThemeState(Object.keys(themes), "dark");
17
@@ -102,3 +103,11 @@ function withQuery(Story, { parameters }) {
102
103
</QueryClientProvider>
104
);
105
}
106
+
107
+// Try to fix storybook rendering fonts inconsistently
108
+// https://www.chromatic.com/docs/font-loading/#solution-c-check-fonts-have-loaded-in-a-loader
109
+const fontLoader = async () => ({
110
+ fonts: await document.fonts.ready,
111
+});
112
113
+export const loaders = isChromatic() && document.fonts ? [fontLoader] : [];
0 commit comments