Answer the question
In order to leave comments, you need to log in
How to set the formatting style of the final file in PostCSS?
In sass, it is possible to set the formatting style of the final file using the outputStyle option, which can accept nested, compact, expanded, compressed
How to do something similar in PostCSS, and more specifically the expanded style?
gulp.task('css', function() {
gulp.src(source + 'style.css')
.pipe(sourcemaps.init())
.pipe(postcss([
postcssPartialImport({prefix: '_', extension: '.css'}),
postcssPresetEnv({
autoprefixer: {
browsers: [
"> 1%",
"last 2 versions",
"Android >= 4",
"Firefox >= 20",
"iOS >= 8"
]
},
features: {
'nesting-rules': true,
'color-mod-function': true,
'custom-selectors': true,
'custom-media-queries': true
}
})
]))
.on('error', gutil.log)
.pipe(sourcemaps.write('.'))
.pipe(gulp.dest(dest + 'css'));
});
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question