Designing for Dual Screen and Foldable Devices with CSS (2023)
Source: Hacker News ↗
Google’s recent launch of the Pixel Fold has revived interest in web design for foldable devices, prompting a look at the CSS tools that let developers adapt layouts to dual‑screen form factors. Two media queries—`(horizontal-viewport-segments: <count>)` and `(vertical-viewport-segments: <count>)`—detect whether a device’s screens sit side‑by‑side like an open book or stacked like a laptop, respectively. Complementing these queries are a set of environment variables (`viewport‑segment‑width`, `viewport‑segment‑height`, `viewport‑segment‑top`, `viewport‑segment‑left`, `viewport‑segment‑bottom`, `viewport‑segment‑right`) that return the exact dimensions and positions of each screen segment, allowing CSS Grid or other layout techniques to allocate content precisely across both displays without hard‑coding device‑specific sizes.
The practical impact of these features is illustrated through a demo that transforms a recipe page into a two‑column layout when viewed on a dual‑screen device. By using the environment variables as grid column values, the first column occupies the entire left screen while the second fills the right, or vice‑versa depending on orientation. This approach works on Microsoft Edge’s stable channel, where the queries and variables are fully supported, and can be tested in Chrome via an experimental flag and the Surface Duo emulator. The author notes that while many developers remain skeptical about investing in dual‑screen experiences, the growing shipment forecast—over 21 million foldables in 2023—suggests a sizable user base that could be reached by leveraging these web standards.
Adopting foldable‑aware design could differentiate a site or app, especially as the Pixel Fold signals the technology’s permanence. However, broader adoption hinges on browser and OS support; Chrome’s lack of stable implementation limits reach, and without consistent platform backing, designers may be reluctant to prioritize dual‑screen layouts. The article encourages developers to use data to assess whether their audience justifies the effort, points to a more detailed tutorial on Smashing Magazine, and ultimately urges the community to experiment with Microsoft Edge to explore the untapped potential of foldable web experiences.
⚡ Effects Interpreter
🌍World Economylow impact
What this means for you
- ▶A story like this rarely stays local for long in a connected economy.
- ▶Markets around the world might take their cue from how this story unfolds.
🏙️Local Economylow impact
What this means for you
- ▶Jobs and trade close to home might feel a soft knock-on effect.
- ▶Local wages and hours worked may bend slightly with the wider trend.
🏦Rates & Bankslow impact
What this means for you
- ▶Your bank is unlikely to act on this alone, but it will be watching.
- ▶Central banks watch moments like this closely, so keep an eye on savings rates.
❤️Healthlow impact
What this means for you
- ▶Community wellbeing might dip a little while people wait for clarity.
- ▶Being kind to yourself matters just as much as staying informed.
💷Wealthmedium impact
What this means for you
- ▶Keeping perspective on your timeline usually beats reacting to any single story.
- ▶Savers with a clear plan tend to feel less rattled by a story like this.
🏠Housinglow impact
What this means for you
- ▶The housing market has a habit of lagging behind the headlines.
- ▶Surveyors and valuers tend to factor in wider trends gradually, not overnight.
🌍 Effects for your country
The U.S.'s central bank rate currently stands at 3.75%, so a global rates move like this could feed through to local borrowing costs. The U.S.'s economy is growing at 2.3% with inflation at 3.2%, the backdrop this story's effects play out against locally. Housing-market effects like this are usually felt most where mortgage rates track the U.S.'s own central bank rate closely. With the U.S.'s unemployment at 4.4%, personal-finance effects like this land on a labour market that is currently fairly stable. Health-system effects are harder to localise from economic indicators alone — the real impact in the U.S. depends more on local healthcare capacity than the figures above.
The UK's central bank rate currently stands at 3.75%, so a global rates move like this could feed through to local borrowing costs. The UK's economy is growing at 0.8% with inflation at 3.2%, the backdrop this story's effects play out against locally. Housing-market effects like this are usually felt most where mortgage rates track the UK's own central bank rate closely. With the UK's unemployment at 5.6%, personal-finance effects like this land on a labour market that is currently fairly stable. Health-system effects are harder to localise from economic indicators alone — the real impact in the UK depends more on local healthcare capacity than the figures above.
France's central bank rate currently stands at 2%, so a global rates move like this could feed through to local borrowing costs. France's economy is growing at 0.9% with inflation at 1.8%, the backdrop this story's effects play out against locally. Housing-market effects like this are usually felt most where mortgage rates track France's own central bank rate closely. With France's unemployment at 7.9%, personal-finance effects like this land on a labour market that is already under strain. Health-system effects are harder to localise from economic indicators alone — the real impact in France depends more on local healthcare capacity than the figures above.
Romania's central bank rate currently stands at 6.5%, so a global rates move like this could feed through to local borrowing costs. Romania's economy is growing at 0.7% with inflation at 7.8%, the backdrop this story's effects play out against locally. Housing-market effects like this are usually felt most where mortgage rates track Romania's own central bank rate closely. With Romania's unemployment at 6%, personal-finance effects like this land on a labour market that is currently fairly stable. Health-system effects are harder to localise from economic indicators alone — the real impact in Romania depends more on local healthcare capacity than the figures above.
The UAE's central bank rate currently stands at 3.65%, so a global rates move like this could feed through to local borrowing costs. The UAE's economy is growing at 3.1% with inflation at 2.5%, the backdrop this story's effects play out against locally. Housing-market effects like this are usually felt most where mortgage rates track the UAE's own central bank rate closely. Health-system effects are harder to localise from economic indicators alone — the real impact in the UAE depends more on local healthcare capacity than the figures above.