Closed 6foot7 closed 6 years ago
Yes. We had Sass support in this boilerplate formerly. But then we moved to styled-components and we removed built-in sass support from the boilerplate. We had local scss
files support earlier. Take a look at this commit. Also we had global scss support. Take a look at scripts
section in our old package.json file. We had node-sass installed in our boilerplate. It was watching the global scss
files in the bundles/scss
directory and compile them in the static/css
directory. Please feel free to ask more if you still have any problem :)
Awesome, thnx for your quick reply! I got it working!
I would like to use both, so import .scss file on component level and use it with and also load a global css in the _document.js. However, the link is added below the jsx styles in the head, so overwriting of global styles is not happening correctly. Did you encounter this as well?
I need to have the link tag above the style jsx tags. If you have any idea that would be great. Also I would like to know what you think of my approach of using global bootstrap and overwriting with styled jsx. Why did you move to another approach eventually?
Nevermind, I got it thnx! I removed _document and included it in the
of my layout.js and that works!Thnx again for your great work!
You could have both working as we had both. Checkout older commits and see next.config.js
, package.json
scripts and .babelrc
files to see how it was working. Then check pages and document.js to see how we were using those configurations in components and pages. Good luck :)
Great Aref, I have it working!
The only thing that doesn’t work now is the hot reload of the css from the static folder whenever it changes. Did you find a way to do that?
Hi, thank you for this awesome boilerplate. I am currently trying to generate a static global css file from .scss files in my styles folder (mainly a themed version bootstrap), that I then want to load via a link in the head in _document.js for example. No luck yet. Have you done this before and could you point me in the right direction for this?