jonkemp / jonkemp/inline-css

Unclear if media queries should be preserved when they're in a css-file

Open
#14 8 comments 5 reactions 0 assignees View on GitHub
feature request
Dominant language
JavaScript
Stars
438
Forks
77
PR merge metrics
No merged PRs in 30d

Description

This issue originally started in [gulp-inline-css](https://github.com/jonkemp/gulp-inline-css/issues/23).

I've played around with the tests in the project and if I change `media-preserve.html` to use `` 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 `` 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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.