iPhone Duo CSS introduces two new tools for foldable screens: the device-posture media query and viewport segments. Safari 27.1 previews both behind feature flags, which visitors must enable themselves. Even so, they reveal exactly where foldable web design is heading, and your layout can prepare for them today.
Key Takeaways
- Two new queries: device posture and viewport segments.
- Safari previews them behind feature flags.
- Keep key content clear of the hinge.
- A flexible layout serves every visitor today.
What Is New in iPhone Duo CSS?
iPhone Duo CSS: new media queries, device posture and viewport segments, that let a page adapt to a foldable screen’s bend and hinge.
According to the WebKit features for Safari 27.1, two new APIs let a page understand the fold. First, Device Posture tells you how the phone is held. Second, Viewport Segments tell you where the hinge splits the screen.
Device posture: folded or flat
This media query reports folded when the phone is partly bent, like a book, and continuous when it lies flat. As a result, you can switch to a two-part layout only when the fold is in use.
@media (device-posture: folded) { }
@media (device-posture: continuous) { }
Viewport segments: either side of the hinge
Segment queries count the screen areas the hinge creates. Meanwhile, matching environment values give each area’s exact size and position. Together, they let you keep text and buttons clear of the fold.
@media (horizontal-viewport-segments: 2) {
.layout { grid-template-columns:
env(viewport-segment-width 0 0) env(viewport-segment-width 1 0); }
}
Why Your Layout Matters Today
The new queries remain previews. However, the iPhone Duo is already in shoppers’ hands. According to WebKit, Safari on the Duo displays pages from 382 to 951 CSS pixels wide, meaning one design must stretch across that entire range.
Fortunately, both Duo screens share the same aspect ratio. Therefore, layouts that scale in proportion feel natural as the phone opens. Our guide to proportional web design on the iPhone Duo explains why this matters.
How to Design for the Fold
- Use the two halves wisely. A list on one side and details on the other suits shops, galleries and email.
- Keep key content off the hinge. Never place a headline, form field or button across the fold.
- Detect features, not devices. Check whether a query matches, rather than guessing from the device name.
- Plan for split view. Your page may share the screen with another app, so test narrow widths too.
- Test in the simulator. Xcode 27.1 includes an iPhone Duo simulator in Device Hub.
To experiment with the new queries, open Settings, Apps, Safari, Advanced and Feature Flags on the Duo. Switch on “Device Posture API” and “Viewport Segments API”.
A Quick PageSpeed Tip
PageSpeed tip: Handle posture changes in CSS wherever possible, rather than with heavy JavaScript listeners. CSS reacts without blocking the main thread, so the page stays responsive as visitors fold and unfold the phone.
iPhone Duo CSS: Common Questions
Can I use iPhone Duo CSS on live websites now?
You can write it now, but only visitors who switch on the feature flags will see it. Meanwhile, a solid responsive layout serves everyone.
Can web content sit behind the Duo’s system controls?
Not at present. WebKit says it is researching alternatives for the outer display.
Do these queries replace normal media queries?
No. Instead, they add fold awareness on top of the width, input and preference queries in our complete guide to media queries for mobile.
The Takeaway
Foldable phones are giving CSS a new sense: the shape of the screen itself. Build a flexible layout now, keep content clear of the hinge, and you will be ready the moment these queries go live.
In short, design for every screen, folded or flat.
Want a website that adapts to every screen? Talk to TheCreatology about web design and development, and #BuildWithAI.
Comments
Felt something? How about posting a comment below…