WebKit Previews Spatial CSS for Working with 3D Objects

WebKit has introduced a limited preview of spatial CSS for building scenes with 3D objects. You can try it in Safari on visionOS 27.3 after enabling the CSS Portals flag.

· 5 min read · 3 comments

On November 17, 2026, WebKit introduced a limited preview of its proposed spatial CSS API. According to the WebKit Blog, it is available in Safari on visionOS 27.3 and, for now, focuses on working with 3D objects through the <model> element. You can try the preview on a Vision Pro or in the visionOS simulator after enabling the CSS Portals flag. This is an opportunity to explore the proposal and provide feedback, not a ready-to-use solution for every browser.

One Shared Scene Instead of Separate Models

The <model> element is available in Safari 27 on all platforms: it displays a single 3D object in its own space. Spatial CSS lets you bring several objects into a scene and position them relative to one another. To do that, you set spatial: portal on a container such as a <div> or <figure>. Its child elements then share the same space.

The preview focuses on models, although the proposed specification also allows this approach to be used with other content. For now, the difference in what you can do is significant: displaying a single 3D object is already possible across Safari platforms, while assembling a scene with the new CSS is only possible in the limited preview.

Models inside a portal can be moved, rotated, and scaled independently using transform. In this context, transforms operate on objects in 3D space. In WebKit’s example, pieces from a children’s construction set are spread out around a board; each can be repositioned separately without reducing the entire composition to a single animation sequence.

To align models precisely, the proposal includes anchoring to reference points. A <model> element cannot have child elements, so you cannot nest one model inside another. Instead, you use position-anchor and position-context: anchor. In the example, the points are defined in a 3D editor and mark where shaped blocks go on the board. This avoids having to work out coordinates by hand; the anchor points can also be used in animations.

Environment Maps, Viewing Controls, and Preview Limitations

The proposed @environment-map rule handles environment maps reflected on a model’s surface. It lets you define a map and use it for elements in the scene. The preview supports 360-degree HDR images. Previously, the map was set through an HTML attribute on <model>; the new syntax is designed, among other things, to let multiple elements share it.

portal-action: orbit lets users rotate the scene while viewing it. When triggered by a user action, the requestVolumetricScene() method brings the associated volumetric scene out of the browser window and into the user’s space. The connection to the page remains: once the scene is launched, objects can be added, removed, or repositioned.

Settings live in CSS so spatial content can be adapted using familiar tools, taking into account aspect ratio, color scheme, and reduced-motion preferences. Numeric values support CSS animations and transitions. JavaScript is still needed, for example, to handle the click that launches a volumetric scene, but not every change to its settings has to be described in JavaScript.

The spatial CSS preview itself is available only on visionOS, although <model> is available in Safari 27 on all platforms. In Safari, you need to enable the CSS Portals flag in advanced settings. WebKit has not given a timeline for these features beyond the preview and is asking developers to report their test results and any issues they encounter.

What This Means for Websites and Teams

If visitors view 3D items one at a time, this news is no reason to rebuild the page. Spatial CSS is more interesting to experiment with when the relative placement of objects matters to the user—for example, when showing how individual parts fit together. A shared scene space and anchors on models are useful for exactly that kind of task.

Developers should keep an eye on how the proposal evolves: WebKit is experimenting with using CSS to define model layouts, environment maps, and viewing controls. For a website owner or marketer, the first question is simpler: does the visitor need this scene instead of an image or a standalone model? While testing requires visionOS and a flag, this is better treated as a separate experiment than as a must-have website feature.

My Take: Start With the Use Case, Then the Technology

I like the idea of using familiar CSS mechanisms where the alternative would be managing numerous scene parameters in code. Anchoring to points seems especially compelling: if objects need to fit together precisely, it makes more sense than manually transferring coordinates from an editor.

But I would not make the preview an essential part of the user journey. While it is limited to visionOS and requires a flag, I would test it in a small use case that is easy to remove. If there is no specific purpose for the scene, adding a spatial dimension will not, on its own, make the page more useful.

Sources

Where the news comes from. The text is a retelling in the author’s own words; the facts come from the source, the opinion is the author’s.

  1. Introducing spatial CSS: A developer preview webkit.org

About the author

Tomas Jankauskas

Staff Software Engineer

I work on frontend and APIs in a product team and help untangle complex incidents. I value small changes that can be rolled back safely.

All posts by the author

Leave a comment

Not published. We’ll send a link to confirm your comment.

No links or ads. Your first comment is published after review. By sending a comment you agree to the privacy notice.

  1. I’ve used grouped 3D assets for product pages, and keeping related parts in one scene would make alignment much easier than tuning separate model viewers; I’d still gate it behind a clear use case until the preview’s browser support matures.

    1. @azizbek_web, that shared-space setup sounds especially useful for product details where parts need to stay aligned as you move around them. I’d be curious how the preview handles positioning when the objects have very different sizes — but yeah, I’d keep it experimental until support is broader 🙂

      1. @nikola.ivanov the preview lets children share a scene and be positioned relative to each other, but it doesn’t yet document special handling for very different object sizes, so i’d test scale and placement in the simulator before relying on it