-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work in Storybook #72
Comments
same issue @BorisZubchenko have you found any solution ? |
Unfortunately, no. I've returned to Inter for now. |
ok thanks I'ill do that |
Hi everyone. I used this workaround to make it work on my project:
staticDirs: [
{
from: "../node_modules/geist/dist/fonts/geist-sans",
to: "/fonts/geist-sans",
},
{
from: "../node_modules/geist/dist/fonts/geist-mono",
to: "/fonts/geist-mono",
},
],
};
import localFont from "next/font/local";
import type { Preview } from "@storybook/react";
import "../src/app/globals.css";
const GeistSans = localFont({
src: "../fonts/geist-sans/Geist-Variable.woff2",
variable: "--font-geist-sans",
});
const GeistMono = localFont({
src: "../fonts/geist-mono/GeistMono-Variable.woff2",
variable: "--font-geist-mono",
});
const preview: Preview = {
decorators: [
(Story) => (
<div className={`${GeistMono.variable} ${GeistSans.variable}`}>
<Story />
</div>
),
],
};
export default preview; |
Doesn't work in Storybook via: vercel/geist-font#72
Using the <link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href="https://fonts.googleapis.com/css2?family=DM+Serif+Display:ital@0;1&display=swap"
rel="stylesheet"
/>
<style>
@font-face {
font-family: "Geist Sans";
src: url("fonts/geist-sans/Geist-Variable.woff2");
}
@font-face {
font-family: "Geist Mono";
src: url("fonts/geist-mono/Geist-Variable.woff2");
}
.dm-serif-display-regular {
font-family: "DM Serif Display", serif;
font-weight: 400;
font-style: normal;
}
.dm-serif-display-regular-italic {
font-family: "DM Serif Display", serif;
font-weight: 400;
font-style: italic;
}
:root {
--font-dm_serif_display: "DM Serif Display", serif;
--font-geist-sans: "Geist Sans", sans-serif;
--font-geist-mono: "Geist Mono", monospace;
}
</style> |
I think this has the same root cause as #59 Closing this as a duplicate of that. |
Font Name (Geist Sans/Geist Mono):
Description of the Issue:
Importing the font into Storybook breaks it. Importing fonts via
next/font
works fine, however.Steps to Reproduce:
Expected Behavior:
Should work
Screenshots:
![image](https://private-user-images.githubusercontent.com/31354262/290174213-12f2e73b-1821-4426-87b3-84bd9307d500.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0NTMzOTMsIm5iZiI6MTczOTQ1MzA5MywicGF0aCI6Ii8zMTM1NDI2Mi8yOTAxNzQyMTMtMTJmMmU3M2ItMTgyMS00NDI2LTg3YjMtODRiZDkzMDdkNTAwLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDEzMjQ1M1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTJjZTgwYjMwYTI5NmYwY2M0YjRlNDQ1OWQ2N2I3ZmUzNzEwZGM4Y2E3ZDQ0ZWI5NDdjYjFjZmUxMjA1ZGMzZWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.HoMlGCMDa0iq1wmPuWPnjo8MlMb6-bIxvS3yYanKLUU)
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: