Post

Replies

Boosts

Views

Activity

Reply to iOS 18 - PWA App Icons: Dark and Tinted Appearance
This is how I implemented it, you’ll need to remove the current icon code then put the paths to the new ones in this JS. (I designed a separate dark mode icon then paired with this JavaScript): function isDarkMode() { return window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches; } let elem = document.createElement('link'); elem.rel = 'apple-touch-icon'; elem.href = isDarkMode() ? '/splash_screens/icon-dark.png' : '/splash_screens/icon.png'; document.head.appendChild(elem); The only downside is that it doesn’t update if the user switches icons to light, they would need to reinstall the PWA.
2w