I need to compile templates using grunt and I want to put the color settings inside a JSON file that will be inside each layout folder, ie I need to use Grunt to read the JSON and pass the values as variables to compile the SASS.
I need to compile templates using grunt and I want to put the color settings inside a JSON file that will be inside each layout folder, ie I need to use Grunt to read the JSON and pass the values as variables to compile the SASS.
There is this plugin for Grunt link
Installation
npm install grunt-json-to-sass --save-dev
Configuration
grunt.initConfig({
json_to_sass: {
your_target: {
files: [
{
src: [
'example.json'
],
dest: '_example.scss'
}
]
},
},
});
I hope it helps!