GithubHelp home page GithubHelp logo

ri-defer-usecases's People

Contributors

wilto avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

ri-defer-usecases's Issues

Container queries and responsive images

Apologies if I'm not correctly following the format of this repo (should I do a PR and write some code instead of creating an issue?)

Over in the Container Queries repo there's an issue discussing syntax, which morphed into (among other things) a discussion of images. The issue I presented was that the sizes attribute in <img/> would need to support container queries, at which point @aFarkas pointed out that that wasn't necessary, as sizes is only needed at parse-time (when container queries may not yet be available). We both came to the conclusion that a possible solution would be to defer selection of the right image until afterwards (when layout information is available).

So here's my use case then: I'm using the wonderful new container queries everywhere, hence I don't know beforehand how big an image will be relative to the viewport (because it's sized relative to its container instead). I want the right image to be pulled from srcset once layout has been calculated, and I don't want any image to be downloaded until then.

In this case (I apologies for jumping directly from use case to implementation) it would make sense to require either sizes or defer/lazysize (but not both) on an image that has dimension-based choices in srcset.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.