Option to use local font files instead of Google fonts, combined option for CDN use (#16)

* option to use local font files instead of GoogleFonts, combined config for CDN use

* set new combined config in exampleSite config

* fix path to fonts when hugo is serving in a subdirectory

* update README for new option

* switch to Fira Sans
This commit is contained in:
dadosch
2020-10-20 18:03:23 +00:00
committed by GitHub
parent a75faae0d7
commit 2edf7ab84b
20 changed files with 1152 additions and 11 deletions

38
static/css/fonts.css Normal file
View File

@ -0,0 +1,38 @@
/* fira-sans-regular - latin */
@font-face {
font-family: 'Fira Sans';
font-style: normal;
font-weight: 400;
src: url('../fonts/fira-sans-v10-latin-regular.eot'); /* IE9 Compat Modes */
src: local('Fira Sans Regular'), local('FiraSans-Regular'),
url('../fonts/fira-sans-v10-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../fonts/fira-sans-v10-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('../fonts/fira-sans-v10-latin-regular.woff') format('woff'), /* Modern Browsers */
url('../fonts/fira-sans-v10-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('../fonts/fira-sans-v10-latin-regular.svg#FiraSans') format('svg'); /* Legacy iOS */
}
/* roboto-mono-regular - latin */
@font-face {
font-family: 'Roboto Mono';
font-style: normal;
font-weight: 400;
src: url('../fonts/roboto-mono-v12-latin-regular.eot'); /* IE9 Compat Modes */
src: url('../fonts/roboto-mono-v12-latin-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../fonts/roboto-mono-v12-latin-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('../fonts/roboto-mono-v12-latin-regular.woff') format('woff'), /* Modern Browsers */
url('../fonts/roboto-mono-v12-latin-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('../fonts/roboto-mono-v12-latin-regular.svg#RobotoMono') format('svg'); /* Legacy iOS */
}
/* ibm-plex-mono-500italic - latin */
@font-face {
font-family: 'IBM Plex Mono';
font-style: italic;
font-weight: 500;
src: url('../fonts/ibm-plex-mono-v6-latin-500italic.eot'); /* IE9 Compat Modes */
src: local('IBM Plex Mono Medium Italic'), local('IBMPlexMono-MediumItalic'),
url('../fonts/ibm-plex-mono-v6-latin-500italic.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../fonts/ibm-plex-mono-v6-latin-500italic.woff2') format('woff2'), /* Super Modern Browsers */
url('../fonts/ibm-plex-mono-v6-latin-500italic.woff') format('woff'), /* Modern Browsers */
url('../fonts/ibm-plex-mono-v6-latin-500italic.ttf') format('truetype'), /* Safari, Android, iOS */
url('../fonts/ibm-plex-mono-v6-latin-500italic.svg#IBMPlexMono') format('svg'); /* Legacy iOS */
}

View File

@ -1,5 +1,3 @@
/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono:ital,wght@1,500&display=swap');
/* Markdown */
:root{
--maincolor: red;
@ -28,7 +26,7 @@ body{
}
p {
font-family: 'IBM Plex Sans', sans-serif;
font-family: 'Fira Sans', sans-serif;
line-height: 1.5;
}
@ -292,4 +290,4 @@ color: royalblue ;
content: 'Markdown';
background: royalblue;
color: whitesmoke ;
}
}