Skip to content

Instantly share code, notes, and snippets.

@akshaykumar6
Created October 20, 2018 13:53
Show Gist options
  • Save akshaykumar6/7a56c5ad8379b4cce945d218d6a67ef3 to your computer and use it in GitHub Desktop.
Save akshaykumar6/7a56c5ad8379b4cce945d218d6a67ef3 to your computer and use it in GitHub Desktop.

Configure Status Bar

In order to change the status bar at the top of the screen (which usually displays the time and battery status) of your progressive web app, you must use the configure few properties for your app to provide complete native look and feel.

Android

Chrome, Firefox and Opera allow you to define color of the status bar using the meta tags.

<!-- Chrome, Firefox OS and Opera -->
<meta name="theme-color" content="#014473">

Example:

iOS

Unfortunately, the number of ways to customize the status bar for iOS devices are fairly limited, but Apple offers the apple-mobile-web-app-status-bar-style meta tag to customize status bar. There are three distinct settings available: default, black, and black-translucent. The default value is default.

This meta tag has no effect unless you add apple-apple-mobile-web-app-capable meta tag.

<meta name="apple-mobile-web-app-capable" content="yes">

Default

The default setting has a white background with black text and symbols.

<meta name="apple-mobile-web-app-status-bar-style" content="default">

Example:

Black

The black setting has a black background and black text and symbols, making it appear completely black.

<meta name="apple-mobile-web-app-status-bar-style" content="black">

Example:

Black-translucent

The black-translucent setting has white text and symbols, and will take the same background color as the body of your web app.

<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
body {
	background-color: #014473;
}

Example:

References:

Android Support

Safari HTML Reference

Safari Web Content Guide

Live Demo

Headlines App

@pinkjimrussiagirl
Copy link

is there a way to do it using just css because i am making a custom css theme on revolt mobile web app and i am trying to make the status bar transparent so i can have a background wallpaper image go through the status bar without having to make a gradient to the background color

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment