Gerillass
v2.1.0Type: Function
fontSource();
Builds one src entry for an @font-face rule.
Arguments
| Name | Type | Description |
|---|---|---|
$font-family | string | Accepts the family name. |
$file-path | string | Accepts path without an extension. |
$file-formats | string | Accepts 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.
@font-face {
font-family: "Inter";
src: fontSource("Inter", "/fonts/inter", woff2),
fontSource("Inter", "/fonts/inter", woff);
}@font-face {
font-family: "Inter";
src: url("/fonts/inter.woff2") format("woff2"), url("/fonts/inter.woff") format("woff");
}