#next/font/google storybook

3 messages · Page 1 of 1 (latest)

stray hill
#

Hello,

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:
```ts
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.
half stratusBOT
#

🔎 This post has been indexed in our web forum and will be seen by search engines so other users can find it outside Discord

🕵️ Your user profile is private by default and won't be visible to users outside Discord, if you want to be visible in the web forum you can add the "Public Profile" role in id:customize

✅ You can mark a message as the answer for your post with Right click -> Apps -> Mark Solution
(if you don't see the option, try refreshing Discord with Ctrl + R)

stray hill
#

Fixed it by adding a decorator to preview.tsx in .storybook