mdixon18's avatar

Can you compile sass with sass-json-vars

I have a .json file i need to @import into my SASS to control color schemes. I know with SASS you can do something like sass scss/style.scss css/style.css -r sass-json-vars.

I want to be able to do the same through mix. I have found a link to something that seems similar but i don't know how to use it with mix.

https://github.com/Updater/node-sass-json-importer

Thanks.

0 likes
1 reply
mdixon18's avatar

After re-reading the laravel documentation for mix i saw that you can send in a third parameter to mix so that you can do something like the following:

let jsonImporter = require('node-sass-json-importer');
mix.sass('resources/assets/sass/style.scss', 'public/css', {
    importer: jsonImporter
});

Please or to participate in this conversation.