Skip to content

Instantly share code, notes, and snippets.

@shuma
Last active June 12, 2020 14:23
Show Gist options
  • Save shuma/0c96d91871a8b02262fc147d7c49939e to your computer and use it in GitHub Desktop.
Save shuma/0c96d91871a8b02262fc147d7c49939e to your computer and use it in GitHub Desktop.
CSS template for self-hosted source fonts
@font-face {
font-display: swap;
font-family: '<NAME_OF_THE_FONT>';
-webkit-font-smoothing: subpixel-antialiased;
font-style: normal;
font-weight: 400;
src: url('webfont.eot'); /* IE9 Compat Modes */
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('webfont.woff2') format('woff2'), /* Super Modern Browsers */
url('webfont.woff') format('woff'), /* Pretty Modern Browsers */
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
@font-face {
font-display: swap;
font-family: '<NAME_OF_THE_FONT>';
-webkit-font-smoothing: subpixel-antialiased;
font-style: normal;
font-weight: 600;
src: url('webfont.eot'); /* IE9 Compat Modes */
src: url('webfont.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('webfont.woff2') format('woff2'), /* Super Modern Browsers */
url('webfont.woff') format('woff'), /* Pretty Modern Browsers */
url('webfont.ttf') format('truetype'), /* Safari, Android, iOS */
url('webfont.svg#svgFontName') format('svg'); /* Legacy iOS */
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment