-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[gatsby-image] Art direction in not working as expected. #29074
Comments
Hi! Sorry to hear you're running into an issue. To help us best begin debugging the underlying cause, it is incredibly helpful if you're able to create a minimal reproduction. This is a simplified example of the issue that makes it clear and obvious what the issue is and how we can begin to debug it. If you're up for it, we'd very much appreciate if you could provide a minimal reproduction and we'll be able to take another look. Thanks for using Gatsby! 💜 |
Here is a minimal reproduction: https://github.com/HenrikDK2/gatsby-image-art-direction-issue |
Hi @HenrikDK2 , const sources = [
mobile.childImageSharp.fluid,
{
...desktop.childImageSharp.fluid,
media: `(min-width: 1600px)`,
},
{
...laptop.childImageSharp.fluid,
media: `(min-width: 1200px)`,
},
{
...tablet.childImageSharp.fluid,
media: `(min-width: 500px)`,
},
] |
Similar #17528
Images are not following the media queries rules when more than 2 images are present in the array.
The above renders the tablet image at 500px, and phone below. Completely ignoring the desktop images.
When switching the order in the array, images renders as following:
Mobile > Tablet > desktopSmall
But now it doesn't render the desktop image.
I would expect it to render depending on the queries specified:
Mobile > Tablet > desktopSmall > desktop
Environment
"gatsby": "^2.30.3",
"gatsby-image": "^2.9.0"
Minimal Reproduction
The text was updated successfully, but these errors were encountered: