Skip to content

[css-viewport-1][css-round-display-1] Add per-edge viewport-fit keys for the viewport <meta> element #14947

Backlog

Description

@pxlcoder

Explainer

viewport-fit=cover lets a page extend underneath the parts of the display that may be obscured, such as the status bar, the sensor housing and the home indicator. It has two problems:

  • Many pages use viewport-fit=cover without keeping their content clear of the unsafe area at every edge with env(safe-area-inset-*), so browsers that honor it at every edge obscure their content. For compatibility, Safari doesn't always honor it.
  • It applies to all four edges of the viewport at once, so a page that wants to extend underneath the unsafe area at one edge has to keep its content clear of it at the other three.

I'd like to propose four new keys for the viewport element: viewport-fit-top, viewport-fit-right, viewport-fit-bottom, and viewport-fit-left. viewport-fit=cover on its own would remain a hint, but not a guarantee that content reaches the edge of the display, for compatibility reasons. Using cover with the per-edge keys would ensure content can actually reach the edge of the display, and gives authors control over individual edges. Please see the explainer linked above for more details.

Note that the viewport <meta> element itself has yet to be fully specified: #12710. viewport-fit itself is currently specified in CSS Round Display 1.

cc @fantasai @bramus @frivoal @emilio

Activity

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

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