I'm using flexbox to organize my divs, the rectangle of x by y is already in another flexbox, which is also in another flexbox... etc. I have to put three other divs inside the x;y rectangle, they will be organized like this:
This is why I need a way to retrieve parent's height (y), in order to assign this value to my middle div's width to make it a square centered in the (x;y) rectangle.
I know there is a way to make calculations at runtime (calc) but maybe I'm missing something and there is a easier way to do what I want to do there.
EDIT: I think I'm a duplicate of this
EDIT2: Not really a duplicate because the topic above is using a px width for parent container, while I'm using 100%. You can find my jsffidle in the comments section.