mart-w.de/static/fonts/lato-font-3.0.0/scss/internal/_mixins.scss
2024-04-03 03:44:07 +02:00

44 lines
1.1 KiB
SCSS

@mixin lato-font-face($variant, $weight: 400, $style: normal, $font-name: $lato-font-name) {
$variant: 'lato-' + $variant;
@if (italic == $style) {
$variant: $variant + '-italic';
}
font-family: $font-name;
font-weight: $weight;
font-style: $style;
text-rendering: optimizeLegibility;
src:
url('#{$lato-font-path}/#{$variant}/#{$variant}.woff2') format('woff2'),
url('#{$lato-font-path}/#{$variant}/#{$variant}.woff') format('woff')
;
}
// Generates font-faces automatically by iterating provided variants map.
@mixin lato-render-variants($variants) {
@each $variant, $weight in $variants {
@include lato-render-variant($variant, $weight);
}
}
// Generates font-face for specified variant and weight.
// This is primarily for internal use.
@mixin lato-render-variant($variant, $weight) {
$font-name: latoGetFontNameForVariant($variant);
// One for regular style.
/* Lato (#{$variant}, regular) */
@font-face {
@include lato-font-face($variant, $weight, normal, $font-name);
}
// One for italic style.
/* Lato (#{$variant}, italic) */
@font-face {
@include lato-font-face($variant, $weight, italic, $font-name);
}
}