unlight / gulp-extract-media-queries

Plugin extracts css rules inside of media queries and saves it to separated files.
19 stars 5 forks source link

Handle browser-prefixes #3

Closed anselmbradford closed 6 years ago

anselmbradford commented 6 years ago

Running this CSS through autoprefixer:

@media ( min-device-pixel-ratio: 2 ), ( min-resolution: 192dpi ) {
     …
}

Ends up with:

@media ( min-device-pixel-ratio:2 ), ( -webkit-min-device-pixel-ratio:2 ), ( min-resolution: 192dpi ){
     …
}

Which creates the file min-device-pixel-ratio2-webkit-min-device-pixel-ratio2min-resolution192dpi.css, but doesn't include -webkit-min-device-pixel-ratio any longer.

unlight commented 6 years ago

And plugin should not include it. The main task of the plugin - completely remove media query and split file. See readme

<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" type="text/css" href="min-width-640px.css" media="(min-width: 640px)" />

This media (min-width: 640px) is supposed to set by hand. This plugin do not generate any html parts or something like that.