I am trying to incorporate a Sassy Modular Scale project into my build using eyeglass . I was able to get the modular scale through the terminal by running the npm install modularscale-sass --save-dev in my project directory.
Then I looked at my package.json , and I saw that "modularscale-sass": "^2.1.1" was added "modularscale-sass": "^2.1.1" , and in my directory I could access the files in the node-modules directory. Things are good! The documentation for modular scale then tells me @import 'modular-scale' in my main.scss file.
Now I run gulp watch and edit some random css and see that gulp complains about any errors and I get a throw error saying
Error: src/scss/main.scss 6:9 file to import not found or unreadable: modular-scale
I know this is happening. bc gulp has no idea where to find modular-scale , because the points are not set correctly atm.
protfolio/ | |-- dest/ | |-- /js | |-- /css | |-- node_modules | |-- modularscale-sass | | .. | |-- src/ | |-- /js | |-- /scss | |-- /modules | |-- .. | |-- /partails | |-- .. | |-- /vendors | |-- .. | |-- main.scss | |-- gulpfile.js | ..
Should I edit eyeglass-exports.js ?
Looking at the js code, I think the most logical thing for me would be to add my directory name and style sheet. My hypothesis is that the module.exports function will return the path for module.exports to find the name of my directory and style sheet. Right?
var path = require('path'); // add my directory and stylesheet? module.exports = function(eyeglass, sass) { return { sassDir: path.join(__dirname, 'stylesheets') } }
I found the documentation on glasses, but it looks rather vague:
In Sass files, you can reference the @import "my_eyeglass_module/file"; module with the standard Sass import syntax: @import "my_eyeglass_module/file"; . my_eyeglass_module will be resolved to the correct directory in your node modules, and the file will then be resolved using standard import rules for Sass.
Can someone please explain how I can make this work.
Here is a link to my github directory
thanks