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

Improve `sizes` query handling #1

Closed dawaltconley closed 7 months ago

dawaltconley commented 1 year ago

Currently several valid sizes query strings are not supported and will throw an error, such as queries using the not keyword, or queries specifying any media type other than all.

I do not intend to handle every valid media query; only those that are useful for responsive images. That said, the not keyword should at least should be supported. Media types may not be necessary, but it may be better to ignore/apply them with a warning rather than throwing an error.

The only supported media features at the moment are min-width, min-height, max-width, and max-height. All others are silently ignored. There may be others worth parsing or others that warrant an error or warning.

dawaltconley commented 1 year ago

The media features I could support (could be validated against device sizes and pixel densities):

Not sure whether I'll get to all of these, but at least the rest can be safely ignored.

Also, any boolean media features (not specifying a value) can be safely ignored because they will evaluate as true across all devices that we're targeting for images.

dawaltconley commented 7 months ago

All of these are supported in v0.5.0, as well as the not and or keywords. Unsupported media types and other features will throw an error.