Skip to content

CSS module: WebXR DOM overlays#44216

Open
estelle wants to merge 8 commits into
mainfrom
xrmod
Open

CSS module: WebXR DOM overlays#44216
estelle wants to merge 8 commits into
mainfrom
xrmod

Conversation

@estelle
Copy link
Copy Markdown
Member

@estelle estelle commented May 21, 2026

Fixes mdn/mdn#808

The :xr-overlay pseudo-class is defined in the https://immersive-web.github.io/dom-overlays/ spec. this adds that module.

@estelle estelle requested a review from a team as a code owner May 21, 2026 16:47
@estelle estelle requested review from hamishwillee and removed request for a team May 21, 2026 16:47
@github-actions github-actions Bot added Content:CSS Cascading Style Sheets docs Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed labels May 21, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

Preview URLs (3 pages)

Flaws (1)

Note! 2 documents with no flaws that don't need to be listed. 🎉

Found an unexpected or unresolvable flaw? Please report it here.

URL: /en-US/docs/Web/CSS/Guides/WebXR_DOM_overlays
Title: WebXR DOM overlays
Flaw count: 1

  • broken_links:
    • Link /en-US/docs/Web/CSS/CSSOM_view is a redirect

(comment last updated: 2026-05-29 01:26:27)

Comment thread files/en-us/web/css/guides/webxr_dom_overlays/index.md Outdated
Comment thread files/en-us/web/css/guides/webxr_dom_overlays/index.md
@estelle estelle requested a review from hamishwillee May 27, 2026 15:58
Comment on lines +9 to +14
The **WebXR DOM overlays** module, an immersive web specification, expands the [WebXR Device API](/en-US/docs/Web/API/WebXR_Device_API) to allow HTML content — such as text and controls — to be displayed during an immersive virtual reality (VR) or augmented reality (AR) session.

In a typical WebXR session, content is rendered to a WebGL canvas superimposed on the real-world camera feed (in AR) or displayed as the full immersive view (in VR), with the device tracking the user's position and orientation.
The DOM overlay renders a single DOM element and its descendants as a transparent-background 2D rectangle on top of this view, enabling interactive, stylable elements such as menus and dialogs to appear within the immersive experience.

The {{cssxref(":xr-overlay")}} pseudo-class matches the DOM overlay element when a web page is being viewed in an immersive AR or VR environment, allowing it to be styled appropriately for its underlying content.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@estelle FYI the intro was repetitive. I've cut it back to this in b353957 - pretty sure no actual information is lost but could you check.

background-color: white;
color: black;
}
```
Copy link
Copy Markdown
Collaborator

@hamishwillee hamishwillee May 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this make the overlay opaque?
Given that in the other doc we have said "... as a transparent-background 2D rectangle on t...." I think we need to make this transparent.

In almost all cases the overlay will be semitransparent, but it isn't that way by magic (I don't think). I think that's what our styling is supposed to do. We can leave the intro of the other doc alone but here we should have an example that styles it as it will be in most cases and explain why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:CSS Cascading Style Sheets docs Content:WebAPI Web API docs size/m [PR only] 51-500 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

document :xr-overlay pseudo-classs

3 participants