shared/grid: allow use of only one variable for padding and margin functions