Calc() outputting unexpected value
问题 What I would like to do is make the #grid height 160% of the #grid width via calc(var(--grid-item-width) * 1.6) , but it appears that --grid-item-width is being treated as a percentage of the viewport width instead of a pixel value. The height of #grid is much larger than 160% of its width as can be seen in the screenshot below. :root { --gap: 26px; --grid-item-width: calc(100% - calc(var(--gap) * 4)); } #grid { width: 100%; height: var(--grid-item-width); /* does not match */ overflow-x: