Gerillass

v2.1.0

Font Source

Type: Function
fontSource();

Builds one src entry for an @font-face rule.

Arguments

NameTypeDescription
$font-familystringAccepts the family name.
$file-pathstringAccepts path without an extension.
$file-formatsstringAccepts one of eot, woff2, woff, ttf, svg.

Examples

Building the src list of your own @font-face rule. Each call makes one entry, so comma-join them for several formats.

Sass
@font-face {
  font-family: "Inter";
  src: fontSource("Inter", "/fonts/inter", woff2),
       fontSource("Inter", "/fonts/inter", woff);
}
CSS
@font-face {
  font-family: "Inter";
  src: url("/fonts/inter.woff2") format("woff2"), url("/fonts/inter.woff") format("woff");
}