preserveMediaQueries has no effect
adammockor opened this issue · 8 comments
Hello, there is old issue for this #5, but it has old dependency.
I got task like this and option "preserveMediaQueries" has no effect. If I got it right, it should inline media queries into head. Is this even possible right know?
gulp.task('inline', ['styles', 'jade'], function() {
return gulp.src('app/index.html')
.pipe(inlineCss({
preserveMediaQueries: true
}))
.pipe(gulp.dest('dist/'));
});
It works as stated in the documentation here.
https://github.com/jonkemp/inline-css#optionspreservemediaqueries
Preserves all media queries (and contained styles) within
<style></style>
tags
The test cases pass. Here is a link to the expected result from this test case.
https://github.com/jonkemp/inline-css/blob/master/test/expected/media-preserve.html
Yeah, right. It really works as documentation says.
Is it anyhow possible to inline media queries from file (link tag)?
I don't know that it's possible to inline media queries.
No, it's not. I achieved desired workflow with gulp-inline-source
like this:
gulp.task('inline', ['styles', 'jade'], function() {
return gulp.src('app/*.html')
.pipe(inlineSource({
rootpath: 'app'
}))
.pipe(inlineCss({
preserveMediaQueries: true
}))
.pipe(gulp.dest('dist/'));
});
Thank you for your time.
No problem!
There is a way to extract the media queries from link tag style.css and input inside body or wherever you need
If you still need it, i can explain how.
I'm looking for a gulp module that will inline the css and place the media queries in the head?