$fontName: "Atkinson Hyperlegible"; $fontId: "atkinson-hyperlegible"; $style: normal; $display: swap; $weight: 400; $fontDir: "~@fontsource/#{$fontId}/files"; $unicodeMap: (latin-ext: (U+0100-024F,U+0259,U+1E00-1EFF,U+2020,U+20A0-20AB,U+20AD-20CF,U+2113,U+2C60-2C7F,U+A720-A7FF), latin: (U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD)); @mixin fontFace( $fontName: $fontName, $fontId: $fontId, $style: $style, $display: $display, $weight: $weight, $fontDir: $fontDir, $unicodeMap: $unicodeMap ) { @each $subset, $unicodeRangeValues in $unicodeMap { @font-face { font-family: "#{$fontName}"; font-style: $style; font-display: $display; font-weight: $weight; src: url("#{$fontDir}/#{$fontId}-#{$subset}-#{$weight}-#{$style}.woff2") format("woff2"), url("#{$fontDir}/#{$fontId}-all-#{$weight}-#{$style}.woff") format("woff"); unicode-range: $unicodeRangeValues; } } } $defSubset: "latin"; $unicodeRange: false; $unicodeRangeValues: (U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD); @mixin fontFaceCustom( $fontName: $fontName, $fontId: $fontId, $style: $style, $display: $display, $weight: $weight, $woff2Path: null, $woffPath: null, $unicodeRange: $unicodeRange, $unicodeRangeValues: $unicodeRangeValues ) { @if $woffPath == null { $woffPath: "#{$fontDir}/#{$fontId}-#{$defSubset}-#{$weight}-#{$style}.woff"; } @if $woff2Path == null { $woff2Path: "#{$fontDir}/#{$fontId}-#{$defSubset}-#{$weight}-#{$style}.woff2"; } @font-face { font-family: "#{$fontName}"; font-style: $style; font-display: $display; font-weight: $weight; src: url("#{$woff2Path}") format("woff2"), url("#{$woffPath}") format("woff"); @if $unicodeRange { unicode-range: $unicodeRangeValues; } } }