Solution 1 :
The color of navigation bar changes according to the colors that you’ve defined in manifest.json
. That manifest is not supported by every browser, you you might want to use some meta
tags to do it.
Check out this repository: https://github.com/gokulkrishh/awesome-meta-and-manifest
Problem :
How to set the Android bottom navigation bar color for a Vue.JS PWA application?
The top address bar changes color correctly, when I set the themeColor
, but the navigation area remains full white (#fff).
I’ve already tried:
In manifest.json:
{
"start_url": "/.",
"display": "standalone",
"background_color": "#000000",
"theme_color": "#000000"
}
In vue.config.js:
module.exports = {
pwa: {
workboxPluginMode: 'InjectManifest',
workboxOptions: {
swSrc: 'public/service-worker.js',
exclude: [
/_redirects/,
/.map$/,
/manifest.json$/
],
},
start_url: '/.',
display: 'standalone',
background_color: '#000000',
themeColor: '#000000',
msTileColor: '#000000',
backgroundColor: '#000000',
theme_color: '#000000'
}
}
Similar to How to change the Android navigation bar color in a PWA?, except that the poster changed his question the color of the buttons.
I think the PWA settings in vue.config.js overwrite/overrule the manifest. But in any case, I am thus far unable to set the color of the bottom navigation area. Kinda annoying when in dark mode.
Comments
Comment posted by Chris Love
I don’t think there is a way to control the bottom button bar. I just checked on my Pixel opening different PWAs and native apps. All but one were the standard black. The Chic Fil a app changed it to a shaded dark red. So I think this has more to do with personal phone settings than application configuration.
Comment posted by Chris Love
And FYI, I use dark mode by default on my phone. Oh and this is not a Vue related question. Different set of concerns.
Comment posted by svenema
Hi Chris, that’s a good insight to have. If it’s not Vue, then any idea what it is?
Comment posted by Chris Love
web manifest is a native web api, not part of any framework. It is a file served by your web server.
Comment posted by bugs.chromium.org/p/chromium/issues/detail?id=797527
I don’t think what you are asking for is possible. This has been an issue for quite some time, but it seems to not be on chromium team’s priority list (see issue tracker:
Comment posted by svenema
Unless you have compelling proof to the contrary, I’m sure that this Github from 2019 does not solve this issue. As far as I understand it, changing the color of this bar is simply not supported yet in 2020. A shame.