Use srcset and sizes attributes?
See original GitHub issueIs it possible to use responsive image markup (srcset
and sizes
) with react-image-lightbox?
I’d like to avoid hard-coding a single mainSrc image file to be used on every screen size… Is there a way to dynamically select the mainSrc image based on the viewport width?
Issue Analytics
- State:
- Created 6 years ago
- Reactions:3
- Comments:5
Top Results From Across the Web
Responsive images - Learn web development | MDN
The srcset attributes contain the path to the image to display. Just as we saw with <img> above, <source> can take a srcset...
Read more >Responsive images with srcset and sizes - Medium
These tag attributes helps serving better images to the user and improves the website loading time.
Read more >Srcset and sizes attributes | | Can I use... Support ... - CanIUse
The srcset and sizes attributes on img (or source ) elements allow authors to define various image resources and "hints" that assist a...
Read more >A Guide to the Responsive Images Syntax in HTML - CSS-Tricks
Using srcset with width ( w ) descriptors like this means that it will need to be paired with the sizes attribute so...
Read more >HTML img sizes Attribute - Dofactory
The srcset and sizes attributes work together to create responsive images. The srcset attribute points to image URLs. And sizes specifies image sizes...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This would be a key, useful feature.
Looking into this. It looks like there’s some styles transform the image dynamically.
with transform css in image
without css transform. at least showing the image at actual size
Basic image passing in being mocked. Let me know if you have any goals for how you’d want to pass in the srcSet, currently thinking:
https://github.com/JackHowa/react-image-lightbox/tree/ISSUE-87-image-src-set