Skip to content
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

Global font for all my stories 6.1.15 #13832

Closed
JohnCasab opened this issue Feb 6, 2021 · 1 comment
Closed

Global font for all my stories 6.1.15 #13832

JohnCasab opened this issue Feb 6, 2021 · 1 comment

Comments

@JohnCasab
Copy link

JohnCasab commented Feb 6, 2021

Hello Storybook community,

I have build a vue-storybook, and tried to add my global font to my stories, but without any luck.

The font I want is:
font-family: "Academy Sans", Arial, sans-serif"

I did accomplish adding my font to the sidebar, by using the following link:

https://storybook.js.org/docs/react/configure/theming

But I have tried to add preview-body.html with style tag and added font-family field, and also tried to make custom.css file and imported that to preview.js, nethier of these approaches has solved my problem.

System:

Node version: v15.4.0
NPM version: 7.0.15
Yarn version: 1.22.10
Eslint local version: 7.2.0
@JohnCasab
Copy link
Author

I solved this issue by overriding, start with creating a src/assets/custom.css file and added the following:

html body *{
    font-family: Academy Sans, Arial, sans-serif !important;
}

And imported this file(custom.css) in .storybook/preview.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants