GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Although discriminating on pixel density plays a big role in determining which icon to choose for a particular context, there are other factors that could come into play. In HTML, this is solved by the link element's media attribute.
I'm going to drop density and in a future version we can add a media attribute to the icon member to allow discrimination using media queries. It's possible to determine which icon to use solely by using the sizes attribute - though it does not handle more advanced use cases where one has the same size icons created for different DPRs.
Sounds good to me... I wasn't a big fan of it anyway
Merge pull request #119 from w3c/remove_density
removed mention of icon density (closes #118)
I'm surprised that this has been dropped. What's the motivation for explicitly not supporting known use cases? Icons are one of those things that are important to get pixel-perfect for a polished app and that's not possible without specifying the scale factor at which an icon was designed (or at least a particular representation for an icon). In particular, a representation designed for 1x at 100x100 may not be the same pixels as one designed for 2x at 50x50dip.
@mrdewitt I strongly agree. We just dropped it from V1 to try to make sure we could get more support from implementers. Simpler spec seemed easier to sell. We also need this on the Moz side. I'm happy to add it back, but want an ok from other implementers.
(Marking as V2 feature for now)
Is this something that's supported by the <meta> icon features? If so I think we can safely assume that implementations are willing to implement.
I wouldn't want any implementations or any web authors avoid implementing/using the manifest and instead to go with due to lack of support for high-density icons.
The HTML spec uses sizes and media attributes and says sizes represent absolute pixel values (meaning that the UA has to divide by the DRP to find the right icon).
So, something like:
<link rel="icon" href="hi-def.ico" sizes="32x32 64x64" media="all and (min-device-pixel-ratio: 2)">
<link rel="icon" href="lo-def.ico" sizes="16x16 32x32">
However, no one implements support for media on icons, so in reality this doesn't actually work.
I have also documented what different UAs do with icons here (bit rough, but good enough):
Are there any known use cases in which media queries would be necessary to achieve good results? "density" seems like the simple/straightforward approach.
Not that I can think of. I think resurrecting the density member should be sufficient.
Merge pull request #222 from w3c/density
Brought back icon density member (closes #118)