Mobile browser addressbar color
See original GitHub issueThe browser addressbar color should be the primary color.
How to do it without tampering with the build system or touching Stylus files: In src/themes.js
(maybe later will move the logic to some other file):
- Check if running on a mobile browser (
import Platform from './platform'):
if Platform.is.mobile && !Platform.is.cordova` - Add an absolute positioned DOM element to
<body>
outside of the viewport (like top -10000px) withbg-primary
CSS class. Also give it some height like10px
. - Use
window.getComputedStyle(<ELEMENT from above>).getPropertyValue('background')
to retrieve the color – which will be the primary color. - Remove the absolute positioned DOM element.
- Add the meta tag to
<head>
using the color determined at step #3.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:7 (3 by maintainers)
Top Results From Across the Web
How to Change the Color of Address Bar in Mobile Browser to ...
This line is a HTML meta tag used by Google Chrome on Android to change color of address bar in mobile browser. The...
Read more >Changing Theme Color of Address Bar in Mobile Browsers
The theme color of the address bar in mobile browsers can be changed using the theme-color meta tag. Any CSS color value can...
Read more >Colorize Mobile Browser Address bar - Plugins - WordPress.org
Colorize Browser Mobile bar plugin will allow you to easily set the color for the browser address bar on mobile devices and phones...
Read more >Change color of website address bar on Chrome Android ...
More videos on YouTube · Change address bar color to match your brand color on mobile · Grab your desired HEX code –...
Read more >How can I change the color of header bar and address bar in ...
Include <meta name="theme-color" content="#db4b5d" /> in the HTML <head> tag. · Open Chrome mobile settings: Scroll down to the theme option.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I’ll implement that over the weekend!
@ag-coder Can you open up a new Github ticket for this pls? “Enhance mobile browser address bar coloring”. I’ll start working on it right now. Will make this optional so every developer can choose to color the addressbar with primary color (default) or another color, or opt out of coloring the address bar. Thanks!