10 ms·
After adding hidpi support to a small web app I am grateful that we are seeing progress in this area. My solution was to use CSS media queries to selectively l
by josho 13y ago
After adding hidpi support to a small web app I am grateful that we are seeing progress in this area.
My solution was to use CSS media queries to selectively load different images. Using media queries this way felt like a kludge, and I knew there must be a better way. The new srcset attribute is definitely a step in the right direction.
Assuming Rails and other frameworks will add support for this I can see that at build time, or page generation time, our web frameworks will look for '@2x' version of images and automatically populate the srcset tag.
- kclay 13y agoI had to do the same thing recently and ended up using "Interchange" from the foundation framework. I did have to hack away at the full background slider (supersized) to support this but it worked out nicely. The thing with media queries is that a browser window at 1400 doesn't fit the min-width:1400, in my case I had to use something like 1375 or some odd size. Maybe its some quirk with how matchMedia works ( what the interchange lib uses) who knows, I'll be glad when we don't have to go through these hoops.