docs: gatsby-plugin-sass global import methods #31229
Replies: 4 comments
-
Yeah, I'm a huge proponent of thorough documentation and not assuming everyone knows everything, because I sure don't. I was involved in the setup and development of my works education website and it was our first time using Gatsby V2 and using CSS modules. We wanted to use SCSS variables and obviously didn't want to import them into every single component manually. Like I mentioned it took me forever to find a method that allowed me to inject them in using that method I took a screenshot of. A tradeoff was that when you inject them in the from the I assumed it would be a good idea to inject my normalize, typography, and global styles in the gatsby config as well because they are rarely changing.. but I was having issues with the ordering of the styles. Normalize was overriding global, and it appeared that no matter what order you put the files, it was just doing it's own thing. Just yesterday playing around with Nuxt, I then found this out while setting up my SCSS: Nuxt style resources posted this warning, and if it's the same situation as in Gatsby? then it would be great to know in the docs as well. Also linking to node/sass docs which don't have any straightforward examples themselves doesn't seem like the best idea. In this line Anyways, these were just some of my experiences, hope this helps, cheers! |
Beta Was this translation helpful? Give feedback.
-
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 30 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
Beta Was this translation helpful? Give feedback.
-
Hey again! It’s been 30 days since anything happened on this issue, so our friendly neighborhood robot (that’s me!) is going to close it. Thanks again for being part of the Gatsby community! 💪💜 |
Beta Was this translation helpful? Give feedback.
-
@gillkyle - Any progress here? I'm totally stuck. I had a working Gatsby 2 project. No matter what I try I can't get it to work with the latest version. It seems like there are multiple things that have changed making it really tough to pinpoint the problem and how to fix it. CSS loader is different, dart-sass is default, some options need to be in Having some global variables and mixins with Sass + CSS modules can't be that uncommon! 😓 |
Beta Was this translation helpful? Give feedback.
-
Summary
There has been confusion with configuring Sass in sites using
gatsby-plugin-sass
because some methods seem to be undocumented.This came up in a Tweet thread:
https://twitter.com/triscodes/status/1237117936281825281
(Copying the text in case the tweet is deleted):
Some recommended topics to cover:
gatsby-browser
file. That could be outlined like the tweet author's method shows in his tweet as well.Motivation
Why should we document this and who will benefit from it?
Users of
gatsby-plugin-sass
, this is also a workflow from #13708.Steps to resolve this issue
Covering more use cases will make these guides more practical for folks using Sass.
Draft the doc
Open a pull request
Beta Was this translation helpful? Give feedback.
All reactions