Skip to content

Use consistent paddings for the first list item

Part of teams/vdg/issues#37.

Right now we halve the top and bottom paddings for DefaultListItem (but not the list item's contentItem) so that the visual spacing between list items isn't excessive. This works.

However it also causes a problem: the top padding for the first list item is inconsistent with its left and right padding.

We can't fix it by just use non-halved paddings for the first list item or else it will be noticeably taller than all other list items. And we can't do it for just the top padding or else its content item will be noticeably un-centered vertically.

To prevent these issues while solving the original problem, we need to actually make the first list item itself taller on top by the exact amount of the extra top margin on the first item's background. Then everything lines up properly.

Before After
Before After

@carlschwan @teams/vdg

Merge request reports