2

I have a dynamically sized grid of square divs, each of which has a height and width of calc(100vmin / ${props => props.gridSize });

This doesn't always divide evenly, so there gaps between the lines of some of my grid lines.

I don't seem have access to SASS/LESS helpers like floor or ceil (they are not included in syled-components/polish either). Plain javascript (Math.floor) doesn't seem to be an option either, since it doesn't know how to handle vh units. Is there any way to ensure a whole pixel number from the result of this calc?

enter image description here

PDN
  • 771
  • 2
  • 13
  • 29
  • I wanted to suggest using a modulo divison, but unfortunately it doesn't seem to exist in calc: http://stackoverflow.com/questions/34435330/using-modulus-in-css-calc-function – nils May 18 '17 at 07:45

0 Answers0