Skip to content

Commit

Permalink
Add fonts locally (#80)
Browse files Browse the repository at this point in the history
* added font definitions and commented font load in index.html

* added woff and woff2 fonts in the project

* added css for the fonts and added the _fonts.scss to base

* removed the google fonts API link from index.html
  • Loading branch information
himankpathak authored and alexdor committed Oct 20, 2018
1 parent 9567fbb commit dedf454
Show file tree
Hide file tree
Showing 17 changed files with 71 additions and 4 deletions.
2 changes: 2 additions & 0 deletions fonts.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
declare module '*.woff'
declare module '*.woff2'
3 changes: 0 additions & 3 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
You need to enable JavaScript to run this app.
</noscript>
<div id="root" style="max-width: 100vw; min-height: 100vh;"> </div>

</body>
<link href="https://fonts.googleapis.com/css?family=Open+Sans|Raleway:300,400,500,600,800" rel="stylesheet" media="none" onload="this.media='all'">


</html>
1 change: 1 addition & 0 deletions src/styles/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ This file acts as a bundler for all variables/mixins/themes, so they
can easily be swapped out without `core.scss` ever having to know.
*/

@import "./base/fonts";
@import "./base/vars";
@import "./base/typography";
@import "./base/overrides";
67 changes: 67 additions & 0 deletions src/styles/base/_fonts.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/* open-sans-regular - latin */
@font-face {
font-display: swap;
font-family: "Open Sans";
font-style: normal;
font-weight: 400;
src: local("Open Sans Regular"), local("OpenSans-Regular"),
url("./fonts/open-sans/open-sans-v15-latin-regular.woff2") format("woff2"),
/* Chrome 26+, Opera 23+, Firefox 39+ */
url("./fonts/open-sans/open-sans-v15-latin-regular.woff") format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}

/* raleway-300 - latin */
@font-face {
font-display: swap;
font-family: "Raleway";
font-style: normal;
font-weight: 300;
src: local("Raleway Light"), local("Raleway-Light"),
url("./fonts/raleway/raleway-v12-latin-300.woff2") format("woff2"),
/* Chrome 26+, Opera 23+, Firefox 39+ */
url("./fonts/raleway/raleway-v12-latin-300.woff") format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* raleway-regular - latin */
@font-face {
font-display: swap;
font-family: "Raleway";
font-style: normal;
font-weight: 400;
src: local("Raleway"), local("Raleway-Regular"),
url("./fonts/raleway/raleway-v12-latin-regular.woff2") format("woff2"),
/* Chrome 26+, Opera 23+, Firefox 39+ */
url("./fonts/raleway/raleway-v12-latin-regular.woff") format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* raleway-500 - latin */
@font-face {
font-display: swap;
font-family: "Raleway";
font-style: normal;
font-weight: 500;
src: local("Raleway Medium"), local("Raleway-Medium"),
url("./fonts/raleway/raleway-v12-latin-500.woff2") format("woff2"),
/* Chrome 26+, Opera 23+, Firefox 39+ */
url("./fonts/raleway/raleway-v12-latin-500.woff") format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* raleway-600 - latin */
@font-face {
font-display: swap;
font-family: "Raleway";
font-style: normal;
font-weight: 600;
src: local("Raleway SemiBold"), local("Raleway-SemiBold"),
url("./fonts/raleway/raleway-v12-latin-600.woff2") format("woff2"),
/* Chrome 26+, Opera 23+, Firefox 39+ */
url("./fonts/raleway/raleway-v12-latin-600.woff") format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
/* raleway-800 - latin */
@font-face {
font-display: swap;
font-family: "Raleway";
font-style: normal;
font-weight: 800;
src: local("Raleway ExtraBold"), local("Raleway-ExtraBold"),
url("./fonts/raleway/raleway-v12-latin-800.woff2") format("woff2"),
/* Chrome 26+, Opera 23+, Firefox 39+ */
url("./fonts/raleway/raleway-v12-latin-800.woff") format("woff"); /* Chrome 6+, Firefox 3.6+, IE 9+, Safari 5.1+ */
}
2 changes: 1 addition & 1 deletion src/styles/base/_vars.scss
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ $color-gravel-approx: #dadada;
$color-cape-cod-approx: #dadada;
$color-tuatara-approx: #dadada;
// Fonts
$font-0: Raleway, sans-serif;
$font-0: "Raleway", sans-serif;
$font-1: "Open Sans", sans-serif;
// Colors
$main-white: #fafafa;
Expand Down
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 comments on commit dedf454

Please sign in to comment.