Skip to content

Mixins

Mixins are imported once and available everywhere:

@use 'mixins' as *;

Mixins are named after what they produce, not how you use them:

  • focus-ring — produces a focus ring
  • padding-box — produces box padding
  • shadow — produces a shadow
  • gradient — produces a gradient

Exception: respond-to — established convention, kept for familiarity.

Apply to the element directly — most mixins generate nested pseudo-class or pseudo-element rules internally:

// ✅ correct — mixin goes on the element
.button {
@include focus-ring;
@include shadow(2);
@include button-primary;
}
// ❌ wrong — focus-ring generates :focus-visible internally
.button:focus-visible {
@include focus-ring;
}
  • stack — flex column with gap
  • flow — margin-based spacing for mixed content
  • scroll-container — overflow scroll container
  • debug — outline all elements