1.0.2 • Published 6 years ago

gulp-sass-import-json v1.0.2

Weekly downloads
23
License
ISC
Repository
github
Last release
6 years ago

gulp-sass-import-json

Gulp plugin for sass

Install

npm i gulp-sass-import-json

Configuration

sassImportJson(options)

options.isSass

Type: Boolean

Set it to true if you want to have SCCS syntax. Otherwise it will be Sass syntax.

Default value is false.

options.cache

Type: Boolean

Cache the imported JSON files. Caching makes builds faster. If you have watch tasks and want to reload changes to the JSOn files, you have to use false.

Default value is true.

Example

//gulp-build.js

var sassImportJson = require('gulp-sass-import-json');

gulp.src('/path/example.sass')
    .pipe(sassImportJson())//add plugin before sass render
    .pipe(gulp.sass())

//example.sass

@import '_variables.json'

div.error
    color: map-get($colors, error)
    font-size: $medium

//_variables.json (JSON: root element must be Object ONLY!)

{
    "colors": {
        "error": "#f00",
        "success": "#0f0"
    },
    "medium": "12px"
}
1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

7 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

9 years ago

0.0.2

9 years ago

0.0.1

9 years ago