【发布时间】:2021-02-11 18:23:24
【问题描述】:
我正在尝试将全局 .scss 文件导入所有页面。
我有以下项目结构
/src
/pages
index.js
index.module.scss
/templates
/restaurants
/hungry
hungry.js
hungry.module.scss
/styles
typography.scss
variables.scss
/package.json
gatsby-plugin-sass
node-sass
/fonts
...
我尝试通过gatsby-plugin-sass 传递选项,并使用此链接gatsby-browser.js 公开全局样式:Include sass in gatsby globally,但没有运气。
我的typography.scss 文件
将选项传递给 gatsby-config.js
使用 gatsby-browser.js 公开全局样式
我也尝试过阅读文档: https://www.gatsbyjs.com/docs/how-to/styling/global-css/
我是 Gatsby 的新手,目前完全没有想法。感谢您的帮助。
谢谢。
【问题讨论】: