-
Notifications
You must be signed in to change notification settings - Fork 23
Description
I was testing around with the current standalone web app header theme color option present in the Web App Manifest and the <meta name="theme-color">
attribute, and I thought that it would be helpful if developers had the ability to change the color that is supplied to the window's title bar labels and window control buttons. Currently, the browser determines what the color for the content should be, and it applies a color that provides enough contrast to keep legibility between the theme color and the labels and window control buttons.
I can see how this may be an issue if one were to apply a color for the labels/window control buttons that doesn't allow for enough contrast for readability, however a possible solution to counteract this would be to use the current implementation of finding a high contrasting color, only if the one supplied by the developer doesn't meet the 4.5:1 contrast ratio, which is what most HTML elements with text are supposed to have.
This will be a helpful addition alongside the Window Controls Overlay API because matching an installed web app's window labels and window control buttons' color to the web app's interface color scheme will further improve design fluidity between system controls and the app's user interface, something that the Window Controls API is trying to solve with providing the ability for developers to customize the title bar.
Demo screenshots of the proposed idea and the possible solution to the content color contrast issue have been attached below.
Current Implementation - Display Mode: Standalone
Current Implementation - Display Mode: Window Controls Overlay
Title bar content does not match the web app's color scheme.
Proposed Idea - Display Mode: Window Controls Overlay
Title bar content is in line with the web app's color scheme.
Example of a Contrast Issue
In instances like the image below, the browser would use a fallback color that allows for more legibility based on the supplied theme color, such as using the default #ffffff
in this case, because #ffffff
would provide enough contrast between the title bar content and the web app's theme color.