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

How to change theme_color programatically? #188

Open
suchorski opened this issue Mar 21, 2025 · 2 comments
Open

How to change theme_color programatically? #188

suchorski opened this issue Mar 21, 2025 · 2 comments

Comments

@suchorski
Copy link

I'm using Nuxt 3.16 and Vite PWA plugin. I'm using SPA and I can't found anything related to change the theme_color to match with the theme from NUxtUI

@userquin
Copy link
Member

userquin commented Mar 21, 2025

If you have a ui theme just pick the color and use manifest: { theme_color: '<your-theme-color>'} in the pwa options.

If the issue is about changing the theme at runtime, you cannot change it in the pwa manifest since it will require to change the pwa manifest when the theme changes and reload the page, and will take some time the user agent (the browser) to change/refresh it: check https://web.dev/articles/manifest-updates

If you have a set of themes you can generate 1 pwa manifest per theme color and swicth the pwa manifest in the head, check:

Anyway, this module is agnostic to the ui lib used with Nuxt.

@suchorski
Copy link
Author

Too many work...

I did like this. Put the meta tag in the nuxt.config And change it with basic JavaScript

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

No branches or pull requests

2 participants