#nextjs 13 fonts

6 messages · Page 1 of 1 (latest)

copper token
#

I can't find in the docs how to apply a font from nextjs in all my stories with import { font } from '@next/font/google

#

I don't want to change the theme of the app, but apply a font to all my stories

digital shale
#

Here's an example component using @next/font/google: https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/template/stories_default-js/Font.jsx

It's used in these stories: https://github.com/storybookjs/storybook/blob/next/code/frameworks/nextjs/template/stories_default-js/Font.stories.jsx

And those stories are used in CI as tests for the @storybook/nextjs framework.

Is that a helpful reference?

To apply to all stories in your Storybook, you'd import and use the font in your preview.js.

copper token
#

Yes. Wrapping Stories in a element with the font.className as class did work

#

Thank you sir 🙏