vite-pwa / nuxt

Zero-config PWA Plugin for Nuxt 3
https://vite-pwa-org.netlify.app/frameworks/nuxt
MIT License
450 stars 22 forks source link

Specyfing different theme colors in manifest for dark mode #104

Open DamianGlowala opened 11 months ago

DamianGlowala commented 11 months ago

As per note in this section:

image

... it would be a nice addition to be able to adjust for the dark mode. Not sure which properties can be adjusted this way though (whether it is only the theme_color and background_color or other as well).

userquin commented 11 months ago

Right now there is no way to add theme variants to webmanifest, you can only create them.

We have it working in elk.zone GH repo with 2 web manifest per locale (i18n + theme variants): https://github.com/elk-zone/elk/blob/main/modules/pwa/i18n.ts

You need to disable manifest entry (manifest: false) and register them manually: