Urgent.News

What's breaking now, across thousands of outlets.

Tech

Designing for Dual Screen and Foldable Devices With CSS

Google's Pixel Fold has reignited discussions about designing for foldable devices. The announcement brought attention to two media queries that can be used to target foldable devices: horizontal-viewport-segments and vertical-viewport-segments. These queries determine how a device is being held, either side-by-side or stacked like a laptop.

Environment variables are also available to help with the geometry of each display on dual screen devices. These variables provide the x and y positions that create a two-dimensional grid, with 0,0 starting at the top-left segment. This allows for automatic calculation of dimensions by the device, eliminating the need to create designs for every unique device.

Using CSS Grid, developers can create layouts that adapt to the device's configuration. For example, a recipe page can change to a two-column layout when on a dual screen device. The environment variables can be used as grid column or row values to place and position content across the two screens. This capability has been implemented in Microsoft Edge Stable, but not yet in Chrome Stable, which is a missed opportunity for Chrome users with the Pixel Fold.

Despite some initial resistance from "naysayers," there are growing numbers of foldable devices being shipped. The forecast for foldables shipped in 2023 is expected to exceed 21 million devices, representing a significant opportunity for designers and developers to create innovative experiences. Ultimately, it is up to businesses to decide whether the investment in dual screen layouts is worth it based on their target audience.

Written by urgent.news from Lobsters's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at blog.stephaniestimac.com →

More in Tech

How to Add Offline Support to Your Web App (without hand-writing a service worker)

The full walkthrough: one config file, an auditable vanilla-JS service worker + client runtime generated for you, zero runtime dependencies — and a live demo you can test offline right now.

  • Swoff is a config-driven generator for service workers and client runtime
  • Run npx @swoff/cli init && npx @swoff/cli generate to set up offline support
  • Verify offline functionality in browser developer tools

Fat jar vs layered jar; DevTools

Why your Spring Boot app is one runnable file You finish a Spring Boot service, run a single command, and a full web server starts up: java -jar app.jar No Tomcat to install first.

  • Spring Boot service compiled into single runnable file
  • Fat jar and layered jar are two packaging options
  • DevTools speeds up development process

More from Saturday 12 September →