grunt-jsontoscss

0.1.0 • Public • Published

grunt-jsontoscss

Convert JSON formatted files into SCSS variable Maps

Getting Started

This plugin Requires Grunt '~0.4.0'

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

$ npm install grunt-jsontoscss --save-dev

After installing the plugin, enable it by adding the NPM load tast to your 'gruntfile.js'

grunt.loadNpmTast('grunt-jsontoscss');

Setting up the grunt-jsontoscss task

Also in your 'gruntfile.js', you'll need to set up a basic task to convert the JSON to readable SASS variable maps. To do so:

grunt.initConfig({
	jsonToScss: {
		task_name: {
			files: {
				src: ["example_a.json", "example_b.json"],
				dest: "_example.scss"
			}
		}
	}
});

When this task is added to a grunt task, it will convert a single file, or multiple, properly formatted JSON files into a single SCSS file with propery formatted variable maps.

Package Sidebar

Install

npm i grunt-jsontoscss

Weekly Downloads

2

Version

0.1.0

License

MIT

Last publish

Collaborators

  • digitalkrony