So, I want to add bourbon, bourbon-neat, and bourbon-bitters to my project using “yarn add”.
Problem is I need the sass files from bourbon-neat and bourbon-bitters to be in my resources/assets/styles folder after addition. How would I go about doing this? I know by default they’d probably go to the node_modules folder.
If you just want to include Bourbon in your scss, you don’t need to move its files. Just add an
@import "~bourbon/bourbon" in your scss entry point.
Thanks, that’s great. However, what about Neat and Bitters, which need to be copied in order to be edited?
Since Bitters is meant to be heavily modified and used as a starting point, there isn’t a good reason to include it with a package manager - see https://github.com/thoughtbot/bitters/pull/30 for discussion around that.
Just install via the ruby gem or copy manually to your preferred location (I have mine at
/resources/assets/styles/base/) then include in your
main.scss after you’ve included Bourbon:
/** Import everything from autoload */
* Import npm dependencies
* Prefix your imports with `~` to grab from node_modules/
* @see https://github.com/webpack-contrib/sass-loader#imports
/** Bourbon & Bitters */
/** Import theme styles */
Edit: I don’t use Neat, but I would assume it’s similar.
I was not aware of that. This does not answer my question, but it taught me what I didn’t know I needed to learn. Thank you.