I used a new solution.
.squares{
width: 30vw
height: 30vw
To main aspect ratio
.aspect-ratio
width: 10vw
height: 10vh
However, this is relative to the entire viewport. So, if you need a div that is 30% of the viewport width, you can use 30vw instead, and since you know the width, you reuse them in height using calc and vw unit.