fix(pwa): use alpha mask for monochrome icon

Per W3C spec, purpose: "monochrome" icons use only the alpha channel
as the silhouette; RGB is ignored and replaced with the platform
theme color. The previous monochrome-icon.png was a black-on-white
RGB image with no alpha, so Safari (macOS PWAs) and Chrome (Android
themed icons) treated every pixel as opaque and painted the whole
1024x1024 canvas with theme_color (#ffa4c0) - a solid pink tile.

Regenerate as RGBA with the silhouette in alpha (derived from the
favicon's alpha channel via a sharp-based helper script). Rename to
monochromeicon.png to bust Safari's stuck PWA icon cache from prior
broken installs.
This commit is contained in:
Julien Calixte
2026-05-05 17:40:40 +02:00
parent fd7d06ce69
commit 58568e2245
4 changed files with 42 additions and 2 deletions

View File

@@ -22,7 +22,7 @@ export default defineConfig(({ command }) => {
"pwa-512x512.png",
"masked-icon.png",
"maskable-icon-512x512.png",
"monochrome-icon.png",
"monochromeicon.png",
"assets/*.svg"
],
manifest: {
@@ -54,7 +54,7 @@ export default defineConfig(({ command }) => {
purpose: "maskable"
},
{
src: "monochrome-icon.png",
src: "monochromeicon.png",
sizes: "1024x1024",
type: "image/png",
purpose: "monochrome"