TL;DR
- Safari 27 on visionOS 27.3 offers a developer preview of spatial CSS, a standards proposal for declarative 3D content control using CSS rather than JavaScript
- The preview includes features like spatial:portal containers, transform-based model movement, position-anchor for snapping 3D objects, @environment-map for lighting control, and portal-action:orbit for scene rotation
- Developers can enable the preview in Safari settings under Feature flags > CSS Portals, or test it in the visionOS Simulator
- The spatial CSS specification is designed to work across devices—phones, tablets, computers, and headsets—using the same media query patterns as 2D responsive design
- Platform
- Safari 27, visionOS 27.3
- Focus
- 3D model element control via CSS
- Status
- Developer preview, limited
What happened
WebKit announced a limited feature preview of spatial CSS in Safari on visionOS 27.3, alongside the full <model> element that is now available in Safari 27 on all platforms. This preview focuses on working with 3D objects through the <model> element using declarative CSS syntax rather than JavaScript, bringing spatial content control in line with how developers style and adapt 2D web content.
What changed
The spatial CSS preview introduces several new CSS features and properties. The spatial:portal declaration allows elements like <div> and <figure> to act as a shared space for child elements, primarily 3D models in this initial preview. Models within a portal can then be moved, rotated, and scaled using the standard transform property, which now operates as a true 3D transform instead of the pseudo-3D transforms used in 2D contexts.
The position-anchor property enables snapping of 3D objects together by referencing anchor points on other models—useful for assembling pieces of furniture or fitting objects into predefined slots. This feature uses position-context:anchor to align and orient objects according to named anchors on a target model.
The @environment-map at-rule, inspired by @keyframes for animations, allows reuse and management of lighting environments across multiple elements. The initial implementation supports 360° HDR images in equirectangular format. The portal-action:orbit property enables users to rotate a scene in place by orbiting around it, mirroring functionality available on the model element's stage-mode attribute but made more flexible through CSS configuration.
A new JavaScript API, requestVolumetricScene(), allows developers to launch spatial content outside the browser window into what WebKit calls a Connected Volumetric Scene. Users can then place and move the scene anywhere in their physical space, with the live link between the web page and volumetric scene enabling updates to object positions and content.
<div class="world" style="spatial:portal;">
<model id="board" src="board.usdz"></model>
<model id="octagon" src="octagon.usdz"></model>
<model id="star" src="star.usdz"></model>
</div>
<style>
#octagon { transform: translateX(-50cm); }
#star { transform: translateX(50cm); }
</style>Why the declarative approach matters
Routing spatial functionality through CSS rather than JavaScript enables developers to use the same patterns they use for responsive 2D design. Media queries targeting aspect ratio, color theme, and reduced motion can now adapt spatial content as well. Numerical parameters in spatial CSS can be animated and transitioned like any other CSS value, reducing the need for complex JavaScript state management.
Spatial content should not be designed only for spatial devices. The preview is limited to visionOS, but WebKit intends spatial web standards to support designing for all browsers—phones, tablets, desktops, and headsets—using unified authoring patterns.
How to test
Developers on Vision Pro can enable the preview by navigating to Settings > Apps > Safari > Advanced > Feature flags > CSS Portals. The visionOS Simulator, available through Xcode, also supports the preview. WebKit has published a spatial CSS demo page and encourages developers to test the features and report feedback via Mastodon (@jensimmons@front-end.social, @jondavis@mastodon.social) or X (@zachernuk, @webkit), or by filing issues at bugs.webkit.org.
What comes next
This developer preview represents the first components of the proposed spatial CSS specification. WebKit acknowledges there is a long journey ahead to complete the broader specification and bring spatial concepts fully to the web. The preview aims to signal how spatial features will be approached in web standards and to gather developer feedback on requirements and opportunities for the emerging spatial web.
Source
WebKit Bloghttps://webkit.org/blog/18621/introducing-spatial-css-a-developer-preview/AI-assisted, verified against the source. This post was drafted with AI from the primary source linked above and checked automatically against it. For anything you depend on, read the original.
- #webgl
- #3dweb
- #css
- #visionos
- #safari


