-
Notifications
You must be signed in to change notification settings - Fork 26
Allow multiple values of importance
depending on media queries
#60
Comments
I might have a counter argument for In a page built with a set of components, we can know that a component (and so images inside) is above the fold (or at least in the "beginning" of the HTML), but the page itself doesn't necessarily know it. So using |
|
I was not aware of that, thanks! |
The only edge-case I can think of that isn't covered either directly by picture or preload is if you need to do viewport-specific prioritization AND auto image format selection. This could potentially be handled by adding support for having a |
This follows a Twitter discussion with @zcorpan. Here is the full thread in one place.
This is a suggestion to discuss the opportunity to let developers define multiple values for
importance
based on Media Queries, like we do for the responsive images.I see at least 2 use cases:
<picture><source media>
, theimportance
can vary based on Art Direction<img srcset sizes>
, theimportance
can vary based on layout changing across viewports, an image being above the fold on large viewports but below on thinner viewportsFor the first use case, we would need to allow using the
importance
attribute onsource
elements (as we need for thealt
attribute).For both use cases, the syntax could be the same as for
sizes
:importance="(min-width: 50em) high, low"
.To ease using multiple times the same Media Queries in
<source media>
,sizes
andimportance
, we could suggest developers to use custom MQs, as suggested by @zcorpan.I talked about viewport based Media Queries here, but some other Media Queries might be useful too.
The text was updated successfully, but these errors were encountered: