gulp-inline-css icon indicating copy to clipboard operation
gulp-inline-css copied to clipboard

options.removeStyleTags having no effect

Open justo opened this issue 8 years ago • 2 comments

Setting {removeStyleTags: true} isn't removing empty style tags.

After inlining the CSS (which works as expected) all of the style blocks in <body> are emptied, but remain in the output:

<style></style>

justo avatar Feb 26 '16 21:02 justo

Can you provide more information, like the gulp task and the html and css files? This defaults to true, and the tests are passing.

jonkemp avatar Feb 27 '16 13:02 jonkemp

Discovered that setting preserveMediaQueries to true prevents style tags from being removed even if they don't contain a media query (and removeStyleTags is true obviously). I encountered this while working on some html emails, where I kept style blocks close to the relevant markup. Many of them didn't contain media queries but the style tags didn't get removed.

I opened a pr on style data: https://github.com/jonkemp/style-data/pull/4

justo avatar Mar 01 '16 18:03 justo