Next.js Discord

Discord Forum

change pwa background color depending on theme

Unanswered
Sloth bear posted this in #help-forum
Open in Discord
Sloth bearOP
Hi, I'd like to know if there's a way to change the background and theme color in the web manifest depending on what theme is chosen, light or dark.

19 Replies

@gin this one?
Sloth bearOP
yes
where do u save the theme?
cookies or localstorage
im pretty sure if its in cookies u can get cookies and set it by that
using the dynamic manifest feature
@gin im pretty sure if its in cookies u can get cookies and set it by that
Sloth bearOP
and what about localstorage? I save it there 😅
for what are u using the manifest for?
Sloth bearOP
create a pwa
so the things that comes to my mind
u could just switch to setting the theme in a cookie
or serving a dynamic manifest on client
idk if just linking a different manifest in headers works
but u could try
as this post is also referencing my idea