Skip to content

Instantly share code, notes, and snippets.

@jensgro
Created February 22, 2023 09:52
Show Gist options
  • Save jensgro/14f2e73aeb523b33107782626edc5214 to your computer and use it in GitHub Desktop.
Save jensgro/14f2e73aeb523b33107782626edc5214 to your computer and use it in GitHub Desktop.
Generated by SassMeister.com.
@mixin font-face($name, $path, $weight: null, $style: null, $exts: woff2 woff) {
$src: null;
@each $ext in $exts {
$src: append($src, url(quote($path + "." + $ext)) format(quote($ext)), comma);
}
@font-face {
font-family: quote($name);
font-style: $style;
font-weight: $weight;
font-display: swap;
src: $src;
}
}
@include font-face(One, fonts/one);
@font-face {
font-family:'Roboto';
font-style: normal;
font-weight: 400;
src:
local('Roboto'), // Erst nachsehen, ob die Schrift
local('Roboto-Regular'), // beim Besucher schon installiert ist
url(fonts/roboto-v18-latin-regular.woff2) format('woff2'), // Wenn nicht, wird die Schrift vom Webserver geladen
url(fonts/roboto-v18-latin-regular.woff) format('woff'); // Am Ende das Schlusslicht für IE11
}
@font-face {
font-family: "One";
font-display: swap;
src: url("fonts/one.woff2") format("woff2"), url("fonts/one.woff") format("woff");
}
@font-face {
font-family: "Roboto";
font-style: normal;
font-weight: 400;
src: local("Roboto"), local("Roboto-Regular"), url(fonts/roboto-v18-latin-regular.woff2) format("woff2"), url(fonts/roboto-v18-latin-regular.woff) format("woff");
}
{
"sass": {
"compiler": "dart-sass/1.32.12",
"extensions": {},
"syntax": "SCSS",
"outputStyle": "expanded"
},
"autoprefixer": false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment