Spaces:
Sleeping
Sleeping
File size: 2,342 Bytes
9d1374f | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 | @use "sass:list";
$font-folder: "../../fonts" !default;
$use-woff2: true !default;
$use-woff: true !default;
$use-ttf: true !default;
$font-display: block !default;
@function generate-src($family, $family-suffix) {
$src: null;
@if $use-woff2 {
$src: list.append($src, url('#{$font-folder}/KaTeX_#{$family}-#{$family-suffix}.woff2') format('woff2'), comma);
}
@if $use-woff {
$src: list.append($src, url('#{$font-folder}/KaTeX_#{$family}-#{$family-suffix}.woff') format('woff'), comma);
}
@if $use-ttf {
$src: list.append($src, url('#{$font-folder}/KaTeX_#{$family}-#{$family-suffix}.ttf') format('truetype'), comma);
}
@return $src;
}
@function generate-suffix($weight, $style) {
$suffix: null;
@if $weight == normal and $style == normal {
$suffix: 'Regular';
}
@if $weight == normal and $style == italic {
$suffix: 'Italic';
}
@if $weight == bold and $style == normal {
$suffix: 'Bold';
}
@if $weight == bold and $style == italic {
$suffix: 'BoldItalic';
}
@return $suffix;
}
@mixin font-face($family, $weight, $style) {
$suffix: generate-suffix($weight, $style);
$src: generate-src($family, $suffix);
@font-face {
font-family: 'KaTeX_#{$family}';
src: $src;
font-weight: $weight;
font-style: $style;
font-display: $font-display;
}
}
@include font-face('AMS', normal, normal);
@include font-face('Caligraphic', bold, normal);
@include font-face('Caligraphic', normal, normal);
@include font-face('Fraktur', bold, normal);
@include font-face('Fraktur', normal, normal);
@include font-face('Main', bold, normal);
@include font-face('Main', bold, italic);
@include font-face('Main', normal, italic);
@include font-face('Main', normal, normal);
@include font-face('Math', bold, italic);
@include font-face('Math', normal, italic);
@include font-face('SansSerif', bold, normal);
@include font-face('SansSerif', normal, italic);
@include font-face('SansSerif', normal, normal);
@include font-face('Script', normal, normal);
@include font-face('Size1', normal, normal);
@include font-face('Size2', normal, normal);
@include font-face('Size3', normal, normal);
@include font-face('Size4', normal, normal);
@include font-face('Typewriter', normal, normal);
|