Answer the question
In order to leave comments, you need to log in
How to include basic styles and fonts in a storybook?
Hello, I am writing a website in react. I'm still making components in the storybook.
The question arose of how to correctly connect fonts styles in a storybook.
The project hierarchy is as follows:
-.storybook
-config.js
-webpack.config.js
-preview-head.html (сюда руками базовые стили и шрифты подключаю, но шрифты не подхватывает)
-node__modules
-public
-fonts
- тут шрифты.woff
-img
- картинки
-favicon.ico
-index.html
-src
-components
- тут компоненты
-containers
- тут контейнеры
-pages
- тут страницы
-App.jsx
-Fonts.styl (тут подключаются шрифты и импортируются в Main.styl)
-index.js
-Main.styl
-Variables.styl (тут переменные)
-.browserslistrc
-.gitignore
-package-lock.json
-package.json
@font-face {
font-family: 'FuturaBook';
font-weight: normal;
src: url('../public/fonts/FuturaBookC.woff'), format('woff'), ;
}
font-face
.styl
-files directly to webpack.config
in .storybook
? Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question