question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Cannot turn off theme coloring (due to PWA default behavior)

See original GitHub issue

What problem does this feature solve?

Vue CLI’s Documentation specifies two configuration values (pwa.themeColor and pwa.msTileColor) that must be set correctly to print the meta tag enforcing theme coloring on various platforms. These are separate from the value set in manifest.json. If the user sets no value, these default to strings '#4DBA87' and '#000000' respectively.

screenshot 2019-01-09 at 20 05 52

In the case that I don’t want to specify this behavior at all though – which I believe is a sensible default due to the obscurity and necessary QA load involved with the impact of this coloring – there seems to be no way to not set these meta tags. Basically the impact is that I must always choose some coloring, even if I don’t want to. A concrete end-user-facing issue this brings up is shown here, in the screenshot from my Galaxy phone’s app switcher:

screenshot_20190109-195755_chrome

To make it clear what’s happening in the picture: the bottom app has the meta tags set to #000000 so the icon appears on a black background. But the icon is designed to be transparent and work on a solid background surface. I also don’t want to se the theme color to white or anything else, I just want it to be whatever the platform uses by default (often it’s a light grey, or something else depending on the platform).

As far as I understand, this is special behavior triggered by the theme coloring that I’d rather not have. The other icon has just a transparent background and no theme coloring.

As far as I know, there is no way to “properly” disable this if the meta tag has to go there. Like maybe you can set an incorrect color value so browsers fail at setting it, but certainly there’s no intuitive way, it’s not documented and for example Google’s developer documentation makes no mention of how to tell the browser/platform to not enforce a theme color at all. Not that I would expect it to: I can’t see why a developer would want to add such client-side configuration to explicitly tell the browser they don’t want it to do anything.

Even though I’d expect no meta tags enforcing active theme coloring to appear by default, I did attempt to cancel this behavior by passing null to both config values, but this still produced the meta tags:

screenshot 2019-01-09 at 19 47 41 screenshot 2019-01-09 at 19 48 34 screenshot 2019-01-09 at 19 48 48

There is more discussion about the confusion around this configuration on forum.vuejs.org

Finally a small disclaimer: it’s really hard to test and debug theme coloring behavior throughout app builds, platforms, Android and Chrome versions etc. It’s partly for this reason that I think it’s best to leave this untouched by default configuration, as not setting any configuration seems to lead to the most stable experience for end users. I’m still not totally sure what are all the moving parts that impact for example the app icon background on my Galaxy test device, but not being able to turn the theme coloring off in a reliable way (i.e. removing meta tags and manifest.json values) is definitely an issue for a developer trying to figure this out.

What does the proposed API look like?

To fix this issue and also ease the pains outlined on the forum, I propose that:

  • When pwa.themeColor or pwa.msTileColor is falsy, the respective meta tags are not printed
  • pwa.themeColor and pwa.msTileColor both default to a falsy value

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:13
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

13reactions
kylemcdonaldcommented, Apr 2, 2019

Working on same project as @jondashkyle above, my preference would be to not add any meta tags unless explicitly specified. If specified, respecting the manifest.json values everywhere would be ideal.

9reactions
LinusBorgcommented, Jan 10, 2019
  1. That you can’t turn it off is something I would consider a bug.
  2. I also think it’s worth discussing to make improve default behaviour. Adding the Vue color as a default is nice as a demo, but since we add it with a bit of magic that’S not very transparent, this might not justify it.
Read more comments on GitHub >

github_iconTop Results From Across the Web

Theme-color isn't applied when in dark mode for PWA's
The omnibox/top bar should be colored with the color set with the theme-color tag. What went wrong? The omnibox/top bar stays on default...
Read more >
Meta Theme Color and Trickery
I found that on iOS pwa mode, if you change theme color, it has an unexpected transition effect, but it doesn't have any...
Read more >
Does not set a theme color for the address bar
Theming the browser's address bar to match the brand colors of your Progressive Web App (PWA) provides a more immersive user experience.
Read more >
App design - web.dev
In contrast, on a desktop device, an application can have more than one ... A desktop PWA showing theme and accent colors, and...
Read more >
android - Disable dark theme in Ionic
One solution I've thought about is explicitly enabling the dark theme, and then setting the same colors for the dark theme as for...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found