Comment

Comment by jordwest

This selector has saved me an inordinate amount of time hacking together UIs quickly:

    .vertical-stack > :not(:last-child) {
      margin-bottom: 8px
    }
Just add the class to a parent and all the children will have spaced between, but no spacing around the edges. It’s then easy to add padding to the parent:

    <div class=“vertical-stack”>
      <h1>Heading</h1>
      <p>Paragraph</p>
      <p>Paragraph</p>
    </div>
parent jordwest 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton