So, I found out that if you have nested fixed elements, and the parent has a transform, then the children acts as an absolute element instead of a fixed element.
Nested fixed element without transform :
.parent {
position: fixed;
background-color: red;
width: 100px;
height: 100px;
top: 50px;
left:50px;
}
.children {
position: fixed;
background-color: blue;
width: 50px;
height: 50px;
top: 0px;
left: 0px;
}
<div class="parent">
<div class="children"></div>
</div>
Nested fixed element with transform on parent :
.parent {
position: fixed;
background-color: red;
width: 100px;
height: 100px;
top: 50px;
left:50px;
}
.children {
position: fixed;
background-color: blue;
width: 50px;
height: 50px;
top: 0px;
left: 0px;
}
.translate {
transform: translate(10px, 0);
}
<div class="parent translate">
<div class="children"></div>
</div>
However I still want the children to be placed like in the first code snippet but with a transform on the parent, any ideas ?