Created
March 21, 2018 19:54
-
-
Save vkemeter/64c50a6e69ae4323ce2b17d116caf504 to your computer and use it in GitHub Desktop.
simple gulp test
This file contains 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
// grid breakpoints, created with gulp task and yaml config | |
// created at: Wed Mar 21 2018 20:51:44 GMT+0100 (CET) | |
$grid-breakpoints: ( | |
xs: 0, | |
sm: 576px, | |
md: 768px, | |
lg: 992px, | |
xl: 1200px, | |
xxl: 1380px, | |
); |
This file contains 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
- breakpoints: { | |
export: { | |
scss: src/scss/abstracts/_breakpoints.scss, | |
}, | |
values: { | |
xs: 0, | |
sm: 576px, | |
md: 768px, | |
lg: 992px, | |
xl: 1200px, | |
xxl: 1380px | |
} | |
} |
This file contains 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
gulp.task('test', function(){ | |
read('src/data/config.yaml', function(err, data) { | |
if (err) { | |
return console.log(err); | |
} | |
for (key in data) { | |
var _entry = data[key]; | |
if (_entry.breakpoints) { | |
var _return = []; | |
for(exports in _entry.breakpoints.export) { | |
if (exports == 'scss') { | |
_return.push('// grid breakpoints, created with gulp task and yaml config'); | |
_return.push('// created at: '+ new Date().toString()); | |
_return.push('$grid-breakpoints: ('); | |
for (breakpoint in _entry.breakpoints.values) { | |
_return.push('\t'+ breakpoint +': '+ _entry.breakpoints.values[breakpoint] +','); | |
} | |
_return.push(');'); | |
} | |
writeFile(_entry.breakpoints.export[exports], _return.join('\n'), function(err) { | |
if (err) console.log(err); | |
}); | |
} | |
} | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment