π Gap
The gap foundation provides a consistent way to apply vertical spacing between elements using row-gap.
Each gap variation is defined through a mixin and compiled into a foundation class. These follow the naming convention:
.f--gap-{variation}
π§ How to use it
Section titled βπ§ How to use itβIn HTML
<div class="f--gap-a"> <div>Item A</div> <div>Item A</div></div>
In SCSS
- Extending the generated foundation class β preferred method:
.c--component-a { @extend .f--gap-a;}
- Using the mixin directly β only if strictly necessary:
.c--component-a { @include make-gap-b();}
π± Responsive logic inside the mixin
Section titled βπ± Responsive logic inside the mixinβUsing media queries inside the mixin gives you fine control over spacing across breakpoints. You can define different gap values per breakpoint by injecting @media blocks directly into each mixin, as shown in the following example:
@mixin make-gap-a { row-gap: 24px; @media all and ($viewport-type: $tablets) { row-gap: 16px; }}