next/font/google storybook
Answered
Polar bear posted this in #help-forum
Polar bearOP
Hello,
I am using the next/font/google like this in pages router:
And in my tailwind config like:
This works when I run it, however, when I open storybook, it does not import the font.
I have googled it and storybook says that the next/font/google is supported without having to put changes, however, that does not work for me.
I am using the next/font/google like this in pages router:
export const inter = Inter({ subsets: ['latin'], variable: '--font-inter' });
function App() {
return <main className={`${inter.variable} font-sans`}>...</main>;
}And in my tailwind config like:
fontFamily: {
sans: ['var(--font-inter)', ...fontFamily.sans]
},This works when I run it, however, when I open storybook, it does not import the font.
I have googled it and storybook says that the next/font/google is supported without having to put changes, however, that does not work for me.
1 Reply
Polar bearOP
Fixed it by adding a decorator to preview.tsx in .storybook
Answer