Generates an @font-face declaration.
Note: This mixin expects fonts to be named a specific way. It uses the font style and font weight values to build out the file name.
For example:
- Normal font:
sourcesanspro.EXT- Normal font:
sourcesanspro.EXT- Italic font:
sourcesanspro-italic.EXT- Bold font:
sourcesanspro-bold.EXT- Light font:
sourcesanspro-300.EXT
- (Note that this uses the weight value not a 'light' string)
- Bold Italic font:
sourcesanspro-bold-italic.EXT
The name of the font family you want to use in your project (eg. 'sourcesanspro');
Default:
'../fonts/#{$font-family}'
The path to the folder containing your font files.
Default: See the Web Font Settings file
A map containing key/value pairs for the File Extension and the Format Name of the font. You can generally rely on the default Spline settings for this.
Default:
normal
The font-weight for the font you're including.
Default:
normal
The font-style for the font you're including.
Default
false
Whether you want to use our built-in Cache Buster to ensure your fonts aren't cached by the browser.
@include web-font(
$font-family: 'sourcesanspro',
$font-weight: bold,
$font-style: italic
);@font-face {
font-family: "sourcesanspro";
font-weight: bold;
font-style: italic;
src: url("../fonts/sourcesanspro/sourcesanspro.woff?5090165236") format("woff"), url("../fonts/sourcesanspro/sourcesanspro.ttf?4493557934") format("truetype"), url("../fonts/sourcesanspro/sourcesanspro.svg?4531890893") format("svg");
}