Skip to content

Customizable Title Bar Content Color #11

@Offroaders123

Description

@Offroaders123

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

STE Window

Current Implementation - Display Mode: Window Controls Overlay
Title bar content does not match the web app's color scheme.

STE Window - Window Controls Overlay

Proposed Idea - Display Mode: Window Controls Overlay
Title bar content is in line with the web app's color scheme.

STE Window - Title Bar Color

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.

STE Window - Low Contrast

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions