@mixin font-face($name, $path, $weight: null, $style: null, $exts: eot woff2 woff ttf svg) {
$src: null;
$extmods: (
eot: "?",
svg: "#" + str-replace($name, " ", "_")
);
$formats: (
otf: "opentype",
ttf: "truetype"
);
@each $ext in $exts {
$extmod: if(map-has-key($extmods, $ext), $ext + map-get($extmods, $ext), $ext);
$format: if(map-has-key($formats, $ext), map-get($formats, $ext), $ext);
$src: append($src, url(quote($path + "." + $extmod)) format(quote($format)), comma); /* stylelint-disable-line function-url-quotes */
}
@font-face {
font-family: quote($name);
src: $src;
font-weight: $weight;
font-style: $style;
// font-display: block;
font-display: swap;
}
}
@include font-face("Montserrat", "/app/fonts/Montserrat/Montserrat-Regular", normal, normal, woff2 woff);
@include font-face("Montserrat", "/app/fonts/Montserrat/Montserrat-Bold", bold, normal, woff2 woff);