why not just use CSS alone:
width = 100vh;
height = 100vw;
Where 100 is the full size (100% of the screen dimension – X(vw) or Y (vh) axis). and 10 would be 10% of same.
These are an uncomplicated and constant means to set elemetns at a specific percentage of the screen width and the screen height respectively, and this also responds to screen re-size elegantly!!