I have a parent div wrapped around a scaled child div. The child div starts off with transform:scale(0,0);
& expands to transform:scale(1,1);
when a button is clicked.
.content-wrapper {
display: inline-block;
background-color: #ddf;
padding: 10px;
clear: both;
}
.content {
padding: 10px;
background-color: #fff;
display: flex-block;
overflow: hidden;
transform:scale(0,0);
transform-origin:top;
transition:transform 1s ease-out;
}
.content.open {
transform:scale(1,1);
}
However the parent div content-wrapper
stays at the same size of the child div content
- even when the child is "closed".
The desired behaviour is when the child div is closed the parent div shrinks to only wrap around the button.
Is it possible to wrap the parent div around the child div when it's "closed" in this example?