Last active
December 25, 2018 13:04
-
-
Save kritollm/a677aff6d8d651f9455342a3e7452450 to your computer and use it in GitHub Desktop.
Converts Bulma CSS framework from SASS to SCSS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Bulma to scss gulp script | |
// In your terminal | |
// 1. npm install -D sass-convert gulp bulma gulp-sass gulp-replace | |
// 2. gem install sass | |
var gulp = require("gulp"), | |
replace = require('gulp-replace'), | |
converter = require('sass-convert'), | |
sass = require('gulp-sass'); | |
gulp.task('sass', function () { | |
return gulp.src('./bulma/bulma.scss') | |
.pipe(sass().on('error', sass.logError)) | |
.pipe(gulp.dest('./bulma/css')); | |
}); | |
gulp.task('bulmaconvert', function () { | |
return gulp.src(['node_modules/bulma/*.+(sass|scss)', | |
'node_modules/bulma/sass/**/*.+(sass|scss)' | |
], { base: './node_modules/bulma/' }) | |
.pipe(converter({ | |
from: 'sass', | |
to: 'scss', | |
rename: true | |
})) | |
// Rename file paths in source files | |
.pipe(replace('.sass"', '.scss"')) | |
.pipe(gulp.dest('./bulma')); | |
}); | |
// 3. gulp bulmaconvert | |
// 4. gulp sass |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
after runnig gulp bulmaconvert :
`events.js:182
throw er; // Unhandled 'error' event
^
Error: spawn sass-convert ENOENT
at exports._errnoException (util.js:1022:11)
at Process.ChildProcess._handle.onexit (internal/child_process.js:189:19)
at onErrorNT (internal/child_process.js:366:16)
at _combinedTickCallback (internal/process/next_tick.js:102:11)
at process._tickCallback (internal/process/next_tick.js:161:9)`
any idea?