Unclear if media queries should be preserved when they're in a css-file
See original GitHub issueThis issue originally started in gulp-inline-css.
I’ve played around with the tests in the project and if I change media-preserve.html
to use <link rel="stylesheet" href="media-preserve.css" />
and move the CSS to that file then no CSS is included in the test output. If I try to add some media-query CSS to any other test that already uses external CSS files as part of the test, like in.html
/file.css
, and set the preserveMediaQueries: true
option, I get the same result: no media query CSS is preserved.
To double check I added some media queries CSS as <style>
in the HTML file I originally had issues with then those media queries are preserved, but the ones in my CSS file are ignored. Maybe this is by design? It’s not super clear from the documentation although reading it now I can imagine it’s technically correct. But since the main use case is Useful for emails
according to the readme and it already supports applyLinkTags
by default, so I assumed it would be preserved since that’s the only way to make media queries work in emails.
Issue Analytics
- State:
- Created 8 years ago
- Reactions:5
- Comments:8 (2 by maintainers)
Same for me. Essential +1.
Interesting that it works in the style tag but not the link tag. I don’t know that this is broken so I’ll add it as a feature request.