Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require an apple touch icon #198

Open
WuglyakBolgoink opened this issue Feb 24, 2018 · 1 comment · May be fixed by #309
Open

Require an apple touch icon #198

WuglyakBolgoink opened this issue Feb 24, 2018 · 1 comment · May be fixed by #309

Comments

@WuglyakBolgoink
Copy link

Why is this important? (see https://sonarwhal.com/docs/user-guide/rules/rule-apple-touch-icons/)

Safari for iOS supports since iOS 1.1.3 a way for developers to specify the image (known as touch icon) that will be used when the user adds the web site/app to the homescreen.

Nowadays there is a better and standard way of specifying images that browsers can use using the web app manifest file, but unfortunately, Safari for iOS doesn’t support that (yet).

Furthermore, over the years, the requirements for the size of the touch icon have changed quite a bit:

  • 57×57px – iPhone with @1x display and iPod Touch
  • 72×72px – iPad and iPad mini with @1x display running iOS ≤ 6
  • 76×76px – iPad and iPad mini with @1x display running iOS ≥ 7
  • 114×114px – iPhone with @2x display running iOS ≤ 6
  • 120×120px – iPhone with @2x and @3x display running iOS ≥ 7
  • 144×144px – iPad and iPad mini with @2x display running iOS ≤ 6
  • 152×152px – iPad and iPad mini with @2x display running iOS 7
  • 180×180px – iPad and iPad mini with @2x display running iOS 8+
    and developers tend to include all these sizes, but there is no need to do that. Declaring just one 180×180px PNG image, e.g.:
<link rel="apple-touch-icon" href="apple-touch-icon.png">

in the <head> of the page is enough.

Including all the different sizes is actually not even recommended as:

It will just increase the size of the pages with very little to no real benefit (most users will probably not add the site to their homescreens).

Most sizes will probably never be used as iOS devices get upgraded pretty quickly, so most iOS users will be on the latest 2 versions of iOS, and using newer devices.

The 180×180px image, if needed, will be automatically down scaled by Safari, and the result of the scaling is generally ok.

The only downside to using one icon is that some users will load a larger image, while a much smaller file would have worked just as well. But the chance of that happening decreases with every day as users upgrade their devices and their iOS version.


At this moment we produce following files:

<link rel="apple-touch-icon" sizes="57x57" href="/assets/favicons/apple-touch-icon-57x57.png">
    <link rel="apple-touch-icon" sizes="60x60" href="/assets/favicons/apple-touch-icon-60x60.png">
    <link rel="apple-touch-icon" sizes="72x72" href="/assets/favicons/apple-touch-icon-72x72.png">
    <link rel="apple-touch-icon" sizes="76x76" href="/assets/favicons/apple-touch-icon-76x76.png">
    <link rel="apple-touch-icon" sizes="114x114" href="/assets/favicons/apple-touch-icon-114x114.png">
    <link rel="apple-touch-icon" sizes="120x120" href="/assets/favicons/apple-touch-icon-120x120.png">
    <link rel="apple-touch-icon" sizes="144x144" href="/assets/favicons/apple-touch-icon-144x144.png">
    <link rel="apple-touch-icon" sizes="152x152" href="/assets/favicons/apple-touch-icon-152x152.png">
    <link rel="apple-touch-icon" sizes="180x180" href="/assets/favicons/apple-touch-icon-180x180.png">
@ollicle
Copy link

ollicle commented Apr 10, 2019

Webhint highlighted this problem is a site I was looking at. Digging through the toolchain that build the favicons led me here.
https://webhint.io/docs/user-guide/hints/hint-apple-touch-icons/#why-is-this-important

@dmnsgn dmnsgn linked a pull request May 25, 2020 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants