You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On mobile devices with notches, developers can use the safe-area-inset-* environment variable to shift the web content and ensure that all content is hidden behind the notch. However, with limited space on small devices, developers want to be able to place content in the area next to the notch as well.
This is something that we would also like to use in our proposed feature for Title Bar Customization in PWAs. If we treat the caption control overlay proposed in the document like a notch, then these new CSS variables would make it easier for developers to style the remaining area next to the overlay.
Although using shape-inside and shape-outside would provide a more accurate representation of the notch, these have not yet been implemented in Chromium or Safari. Below is a less robust, but simpler solution to working around a notch
Proposal:
Following the pattern of safe-area-inset-*s, we propose new CSS environment variables to define the insets of the unsafe notch area in more detail:
Horizontal insets of the notch on the top edge of the screen
- unsafe-area-top-inset-left
- unsafe-area-top-inset-right
- Horizontal insets of the notch on the bottom edge of the screen
- unsafe-area-bottom-inset-left
- unsafe-area-bottom-inset-right
- Vertical insets of the notch on the left edge of the screen
- unsafe-area-left-inset-top
- unsafe-area-left-inset-bottom
- Vertical insets of the notch on the right edge of the screen
- unsafe-area-right-inset-top
- unsafe-area-right-inset-bottom
For example, when defining a notch on the top of the screen, you can define its position via the insets from the edges of the window:
- top inset: 0
- left inset: env(unsafe-area-top-inset-left)
- bottom inset: env(safe-area-inset-top)
- right inset: env(unsafe-area-top-inset-right)
The text was updated successfully, but these errors were encountered:
…le bar (#212)
Update explainer to use and explain new CSS environment variables: `unsafe-area-top-inset-left/right`.
CSS working group proposal:
- [[css-env] Add environment variable for left/right bounds of notch](w3c/csswg-drafts#4721)
Related issues:
- #177 Title bar customization: new CSS properties for easier layout
- #203 [Title Bar Customization] Consider using css env variables for `controlsOverlay` bounding rect
…le bar (MicrosoftEdge#212)
Update explainer to use and explain new CSS environment variables: `unsafe-area-top-inset-left/right`.
CSS working group proposal:
- [[css-env] Add environment variable for left/right bounds of notch](w3c/csswg-drafts#4721)
Related issues:
- MicrosoftEdge#177 Title bar customization: new CSS properties for easier layout
- MicrosoftEdge#203 [Title Bar Customization] Consider using css env variables for `controlsOverlay` bounding rect
CSS Environment Variables
On mobile devices with notches, developers can use the
safe-area-inset-*
environment variable to shift the web content and ensure that all content is hidden behind the notch. However, with limited space on small devices, developers want to be able to place content in the area next to the notch as well.This is something that we would also like to use in our proposed feature for Title Bar Customization in PWAs. If we treat the caption control overlay proposed in the document like a notch, then these new CSS variables would make it easier for developers to style the remaining area next to the overlay.
Although using
shape-inside
andshape-outside
would provide a more accurate representation of the notch, these have not yet been implemented in Chromium or Safari. Below is a less robust, but simpler solution to working around a notchProposal:
Following the pattern of
safe-area-inset-*
s, we propose new CSS environment variables to define the insets of the unsafe notch area in more detail:-
unsafe-area-top-inset-left
-
unsafe-area-top-inset-right
- Horizontal insets of the notch on the bottom edge of the screen
-
unsafe-area-bottom-inset-left
-
unsafe-area-bottom-inset-right
- Vertical insets of the notch on the left edge of the screen
-
unsafe-area-left-inset-top
-
unsafe-area-left-inset-bottom
- Vertical insets of the notch on the right edge of the screen
-
unsafe-area-right-inset-top
-
unsafe-area-right-inset-bottom
For example, when defining a notch on the top of the screen, you can define its position via the insets from the edges of the window:
- top inset:
0
- left inset:
env(unsafe-area-top-inset-left)
- bottom inset:
env(safe-area-inset-top)
- right inset:
env(unsafe-area-top-inset-right)
The text was updated successfully, but these errors were encountered: