CSS Foldable Display Polyfill
Foldable phones are beginning to ship, and they have browsers on them. For web designers, that means eventually wanting to know where the hinge sits so layouts can be built for the top and bottom halves — or the left and right halves.
Coming as env() constants
The expectation is that this information reaches developers through env() constants, the same mechanism behind the notch. The polyfill repo's code block reads:
@media (spanning: single-fold-vertical) {
body {
flex-direction: row;
}
.map {
flex: 1 1 env(fold-left)
}
.locations-list {
flex: 1;
}
}
An alternative proposed in the piece:
@media (spanning: single-fold-vertical) {
.page-wrap {
display: grid;
grid-template-columns: env(fold-left) 1fr;
}
}
No fold-right?
The absence of a fold-right constant stands out. Given the general move away from directional terms toward logical properties, why not fold-inline-start?
- As for the two-halves framing: it will be interesting to see how that sentence ages — just watch the first really popular foldable phone ship with three segments.



