frontend-frameworks
frontend-frameworks copied to clipboard
[responsive()]: Step is not taken into account
Hi, I'm using the React SDK and the responsive()
plugin doesn't seem to work properly for me.
Basically, regardless of the value I input in the plugin (ex: 400
, [400, 800, 1200]
), the scale that is fetched always matches the parent element.
So I get weird scales like 512, 647, ...
What I would expect
- If the step is set to 400, the only scales that can be fetched would be 400, 800, 1200, 1600, ...
- On retina, if the container width is 400, the image fetched should be 800
- Images set to
object-fit: cover
, should still look good. (The aspect ratio of the image should also be taken into account when comparing to the container)
The SDK V1 was more complete regarding the responsive behaviors.
Alternatives
- Add a
sizes
prop (setting it would opt-out of the container width; based responsive)