Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-json-to-sass

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-json-to-sass

Gulp plugin which takes the input of JSON and outputs SCSS variables

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gulp-json-to-sass

Gulp plugin which takes the input of JSON and outputs SCSS variables. The reason you might want to do this is so you can share the variables between your JS and your CSS.

Install

$ npm install --save-dev gulp-json-to-sass

Usage

var gulp = require('gulp');
var jsonToSass = require('gulp-json-to-sass');

gulp.task('default', function () {
	return gulp.src('src/sass/**/*.scss')
		.pipe(jsonToSass({
            jsonPath: 'src/scripts/_variables.json',
            scssPath: 'src/sass/_variables.scss'
        }))
        .pipe(sass())
		.pipe(gulp.dest('dist/css'));
});

JSON Syntax

{ "color1": "#E90649", "color2": "#F12403", "color3": "#FF6300", "color4": "#FF9900", "color5": "#F3B303", "color6": "#B1CB21", "color7": "#75BB03", "color8": "#04C197", "color9": "#089BEE", "color10": "#4728A2", "color11": "#7E05CE", "color12": "#892103", "color13": "#606060" }

This will output:

$color1: #E90649; $color2: #F12403; $color3: #FF6300; $color4: #FF9900; $color5: #F3B303; $color6: #B1CB21; $color7: #75BB03; $color8: #04C197; $color9: #089BEE; $color10: #4728A2; $color11: #7E05CE; $color12: #892103; $color13: #606060;

License

MIT © Jonathan Fielding

Keywords

FAQs

Package last updated on 07 Aug 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc