Viewport segments
Keeps the turntable and the controls out of a folding phone's crease.

How Riff uses it
Where the browser reports a fold, the horizontal-viewport-segments and vertical-viewport-segments media queries say whether it runs down the screen or across it, and the viewport-segment-width, viewport-segment-height and edge variables give each segment's size. Folded like a book, Now Playing's grid takes its two columns from the two segments, the deck on the left page and the controls on the right, with the crease as the gap between them; stood like a tent, it takes two rows, the sleeve and the turntable above and the controls below.
Why
An iPhone Duo can be half open, and anything centred on the whole screen lands in the fold. The browser knows where the fold is; the layout follows it rather than guessing from the screen's size.
Without it
Without it, as in Safari until its flag is on, the unfolded layout holds: the screen is one turntable, crease and all.
Where
- plugins/riff/assets/riff.css, line 3013
@media (horizontal-viewport-segments: 2) { - plugins/riff/assets/riff.css, line 3021
grid-template-columns: env(viewport-segment-width 0 0) env(viewport-segment-width 1 0);
Links open the source at the commit this page was published from.
Specification: CSS Environment Variables Module Level 1. Reference: Viewport segments on MDN.