terminal42 / contao-pageimage

MIT License
12 stars 13 forks source link

Do not add media query, if there is no density or media query #43

Closed fritzmg closed 4 years ago

fritzmg commented 4 years ago

It can happen, that the srcset only contains the main image, i.e. the src, without any density descriptor. Also, generally, a media query must only be added, if either a density is present, that is not equal to one, or a media query within the source is present. Otherwise you end up with

@media screen and  {
    …
}
fritzmg commented 4 years ago

If you only have a 1x density, then no media query is necessary.