properly handling items margin and grid paddings