Skip to content

Commit 6433499

Browse files
Add some default styling to DOM-Overlay (#4901)
1 parent 0b6b0ae commit 6433499

File tree

3 files changed

+18
-17
lines changed

3 files changed

+18
-17
lines changed

examples/boilerplate/webxr-ar-lighting/index.html

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,23 +8,6 @@
88
body {
99
font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
1010
}
11-
12-
13-
#dom-overlay {
14-
overflow: hidden;
15-
position: absolute;
16-
pointer-events: none;
17-
box-sizing: border-box;
18-
bottom: 0;
19-
left: 0;
20-
right: 0;
21-
top: 0;
22-
padding: 1em;
23-
}
24-
25-
#dom-overlay>* {
26-
pointer-events: auto;
27-
}
2811
</style>
2912
</head>
3013

src/style/aframe.css

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,3 +396,19 @@ a-scene audio {
396396
background-color: #00ceff;
397397
width: 100%;
398398
}
399+
400+
.a-dom-overlay:not(.a-no-style) {
401+
overflow: hidden;
402+
position: absolute;
403+
pointer-events: none;
404+
box-sizing: border-box;
405+
bottom: 0;
406+
left: 0;
407+
right: 0;
408+
top: 0;
409+
padding: 1em;
410+
}
411+
412+
.a-dom-overlay:not(.a-no-style)>* {
413+
pointer-events: auto;
414+
}

src/systems/webxr.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ module.exports.System = registerSystem('webxr', {
2222
};
2323
this.sessionReferenceSpaceType = data.referenceSpaceType;
2424

25+
data.overlayElement.classList.remove('a-dom-overlay');
2526
if (data.overlayElement) {
2627
this.warnIfFeatureNotRequested('dom-overlay');
2728
this.sessionConfiguration.domOverlay = {root: data.overlayElement};
29+
data.overlayElement.classList.add('a-dom-overlay');
2830
}
2931
},
3032

0 commit comments

Comments
 (0)