<div> </div> <style> --val:50; div{ background:red; width:calc(1% * --val); height:calc(1% * --val); } </style>
<div> </div> <style> body{ height: 400px; } :root{ --val:50; } div{ background:red; width:calc(1% * var(--val)); height:calc(1% * var(--val)); } </style>