Skip to content

Instantly share code, notes, and snippets.

@hiwelo
Last active August 20, 2020 12:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save hiwelo/0c65e70a4c81a1862faa to your computer and use it in GitHub Desktop.
Save hiwelo/0c65e70a4c81a1862faa to your computer and use it in GitHub Desktop.
@font-face declarations for modern browsers
/**
* @font-face declaration for :
* - Internet Explorer >= 9.0
* - Firefox >= 3.6
* - Chrome >= 5
* - Safari / iOS >= 5.1
* - Opera >= 11.5
* - Android >= 4.4
* */
@font-face {
font-family: Ma Typo; /* You can call this font in a font stack as "My Typo" or My Typo */
font-style: normal; /* You can declare several @font-face with the same font-family and differents font-style */
font-weight: 400; /* You can declare several @font-face with the same font-family and differents font-weight */
src: local('matypo-regular'), /* PostScript file name for this font variant (i.e. SourceSansPro-Regular) */
url('URL_TO_FILE.woff2') format('woff2'),
url('URL_TO_FILE.woff') format('woff');
}
/**
* A bold variant, for example
* */
@font-face {
font-family: Ma Typo;
font-style: normal; /* You can declare several @font-face with the same font-family and differents font-style */
font-weight: 700; /* You can declare several @font-face with the same font-family and differents font-weight */
src: local('matypo-bold'), /* PostScript file name, as exemple SourceSansPro-Semibold */
url('URL_TO_FILE_BOLD.woff2') format('woff2'),
url('URL_TO_FILE_BOLD.woff') format('woff');
}
/**
* @font-face declaration for :
* - Internet Explorer >= 6.0
* - Firefox >= 3.6
* - Chrome >= 5
* - Safari / iOS >= 5.1
* - Opera >= 11.5
* - Android >= 4.4
* */
@font-face {
font-family: Ma Typo;
font-style: normal; /* You can declare several @font-face with the same font-family and differents font-style */
font-weight: 400; /* You can declare several @font-face with the same font-family and differents font-weight */
src: local('matypo-regular'), /* PostScript file name, as exemple SourceSansPro-Regular */
url('URL_TO_FILE.eot?') format('eot'), /* ? is a small IE fix */
url('URL_TO_FILE.woff2') format('woff2'),
url('URL_TO_FILE.woff') format('woff');
}
/**
* A bold variant, for example
* */
@font-face {
font-family: Ma Typo;
font-style: normal; /* You can declare several @font-face with the same font-family and differents font-style */
font-weight: 700; /* You can declare several @font-face with the same font-family and differents font-weight */
src: local('matypo-semibold'), /* PostScript file name, as exemple SourceSansPro-Semibold */
url('URL_TO_FILE_BOLD.eot?') format('eot'), /* ? is a small IE fix */
url('URL_TO_FILE_BOLD.woff2') format('woff2'),
url('URL_TO_FILE_BOLD.woff') format('woff');
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment