convert = n =>
  typeof n === `string` && n.trim().endsWith(`%`) ? NaN : parseInt(n, 10)
Convert anything to number, except for % value.
We don't have to check for other values (em, vw, etc.)
because the browsers will treat them as px anyway.
@param {*} n something to be converted to number
@returns {number}