QuickSnip LogoA light blue logo with a thunderbolt in bracketsQuickSnip

Font Import Helper

Simplifies importing custom fonts in Sass.

  • mixin
  • fonts

Code

@mixin import-font($family, $weight: 400, $style: normal) {
  @font-face {
    font-family: #{$family};
    font-weight: #{$weight};
    font-style: #{$style};
    src: url('/fonts/#{$family}-#{$weight}.woff2') format('woff2'),
         url('/fonts/#{$family}-#{$weight}.woff') format('woff');
  }
}