Answer the question
In order to leave comments, you need to log in
How to format css after executing gulp-group-css-media-queries?
gulpfile.js has this task:
let { src, dest } = require('gulp'),
gulp = require('gulp'),
browsersync = require('browser-sync').create(),
scss = require('gulp-sass')(require('sass')),
autoprefixer = require('gulp-autoprefixer'),
group_media = require('gulp-group-css-media-queries'),
rename = require('gulp-rename'),
clean_css = require('gulp-clean-css');
function css() {
return src('./#src/scss/style.scss')
.pipe(
scss({
outputStyle: 'expanded',
indentType: 'tab',
indentWidth: 1
})
.on('error', scss.logError)
)
.pipe(
autoprefixer({
overrideBrowserslist: ['last 2 versions'],
cascade: false
})
)
.pipe(group_media())
.pipe(dest('./build/css/'))
.pipe(clean_css())
.pipe(rename({
extname: '.min.css'
}))
.pipe(dest('./build/css/'))
.pipe(browsersync.stream());
}
scss()
);autoprefixer()
);group_media()
);/build/css/
( dest()
);clean_css()
);rename()
);/build/css/
( dest()
).group_media()
css is formatted with default settings css-stringify
(run in gulp-group-css-media-queries
), overwriting those specified in scss()
, in particular indent
. gulp-group-css-media-queries
It cannot take any parameters itself . group_media()
and dest()
additionally clean_css()
with the necessary settings, but I get an error:Error: Ignoring local @ import of "#src/scss/style.css" as resource is missing.
gulp-cssbeautify
?
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