Hey there! I'm currently working with Sage, a WordPress framework, and I have a question regarding the integration of Materialize CSS. When creating my project, Sage provides options to choose various CSS frameworks but I specifically want to use Materialize CSS instead.
To incorporate Materialize CSS, I used Webpack to compile and merge the .scss files into one. After installing materialize-css via npm, I added it to my node_modules directory. Within my project structure, I created an scss file to import the module effectively.
Additionally, my build also includes Bulma which was initially included during creation. To understand how the structure is set up, I looked at the import statement for Bulma:
@import "~bulma";
I found this confusing as well. My assumption is that the tilde symbol (~) in the import statement signifies something to Webpack, possibly directing it to search for the package in the node_modules directory based on the information in package.json.
Despite trying @import "~materialize-css";
, I haven't had any success. Can anyone shed some light on what exactly Webpack is doing in this scenario? The lack of documentation is making it difficult for me to grasp.
If you'd like to take a look at the folder structures within the node_module directories, here's a screenshot: https://i.sstatic.net/GYNIR.png
It seems that the root file for Bulma is bulma.sass
while for Materialize-CSS, it's located in sass/materialize.scss
.
If necessary, you can find the github link for the Sage framework where the webpack.config.js file resides in the build folder: https://github.com/roots/sage/tree/master/resources/assets