dawaltconley / responsive-images

Static site image processing. Currently a wrapper around eleventy-img.
https://dawaltconley.github.io/responsive-images/
ISC License
1 stars 0 forks source link

Media queries should target height as well as width #3

Open dawaltconley opened 1 year ago

dawaltconley commented 1 year ago

It should be possible to set height requirements on background images and picture elements (using the media property of their source elements).

Generating the right media queries and markup is not too much of a problem; I got something like this working on a previous (Jekyll-specific) iteration. The bigger issue is how to specify height-and-width requirements.

I originally wrote the bg-size-parser to help with this, since I mostly find height restrictions useful for background images. Ideally, I'd like to use syntax / examples being proposed for a future sizes/srcset spec.