Skip to content

Commit

Permalink
Self-host fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
kimmy committed May 19, 2018
1 parent 47a94f4 commit a8e89e3
Show file tree
Hide file tree
Showing 14 changed files with 1,272 additions and 19 deletions.
25 changes: 25 additions & 0 deletions src/assets/css/fonts.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
@font-face {
font-family: 'Caveat';
font-style: normal;
font-weight: 400;
src: url('../fonts/caveat-regular.eot'); /* IE9 Compat Modes */
src: local('Caveat Regular'), local('Caveat-Regular'),
url('../fonts/caveat-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../fonts/caveat-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('../fonts/caveat-regular.woff') format('woff'), /* Modern Browsers */
url('../fonts/caveat-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('../fonts/caveat-regular.svg#Caveat') format('svg'); /* Legacy iOS */
}

@font-face {
font-family: 'Lato';
font-style: normal;
font-weight: 400;
src: url('../fonts/lato-regular.eot'); /* IE9 Compat Modes */
src: local('Lato Regular'), local('Lato-Regular'),
url('../fonts/lato-regular.eot?#iefix') format('embedded-opentype'), /* IE6-IE8 */
url('../fonts/lato-regular.woff2') format('woff2'), /* Super Modern Browsers */
url('../fonts/lato-regular.woff') format('woff'), /* Modern Browsers */
url('../fonts/lato-regular.ttf') format('truetype'), /* Safari, Android, iOS */
url('../fonts/lato-regular.svg#Lato') format('svg'); /* Legacy iOS */
}
19 changes: 2 additions & 17 deletions src/assets/css/styles.js
Original file line number Diff line number Diff line change
@@ -1,26 +1,11 @@
import React from "react";
import { injectGlobal } from "react-emotion";

const LatoBlackTTF = "../fonts/Lato-Black.ttf";
const CaveatRegularTTF = "../fonts/Caveat-Regular.ttf";
import "./fonts.css"

injectGlobal`
body {
font-family: 'Lato', sans-serif;
}
@font-face {
font-family: "Lato", sans-serif;
font-style: normal;
font-weight: 400;
src: local("Lato Black"), local("Lato-Black"), url(${LatoBlackTTF}) format("ttf");
}
@font-face {
font-family: "Caveat", cursive;
font-style: normal;
font-weight: 400;
src: local("Caveat Regular"), local("Caveat-Regular"), url(${CaveatRegularTTF}) format("ttf");
}
`;

const centerClass = `
Expand Down
1 change: 1 addition & 0 deletions src/assets/css/variables.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
import React from "react"
Binary file added src/assets/fonts/caveat-regular.eot
Binary file not shown.
809 changes: 809 additions & 0 deletions src/assets/fonts/caveat-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/fonts/caveat-regular.ttf
Binary file not shown.
Binary file added src/assets/fonts/caveat-regular.woff
Binary file not shown.
Binary file added src/assets/fonts/caveat-regular.woff2
Binary file not shown.
Binary file added src/assets/fonts/lato-regular.eot
Binary file not shown.
435 changes: 435 additions & 0 deletions src/assets/fonts/lato-regular.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/assets/fonts/lato-regular.ttf
Binary file not shown.
Binary file added src/assets/fonts/lato-regular.woff
Binary file not shown.
Binary file added src/assets/fonts/lato-regular.woff2
Binary file not shown.
2 changes: 0 additions & 2 deletions src/assets/scss/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
@import 'libs/mixins';
@import '../css/font-awesome.min.css';
@import url("https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,400italic");
@import url("https://fonts.googleapis.com/css?family=Caveat");
@import url("https://fonts.googleapis.com/css?family=Lato");

/*
Strata by HTML5 UP
Expand Down

0 comments on commit a8e89e3

Please sign in to comment.