Skip to content

Commit

Permalink
Add custom fonts
Browse files Browse the repository at this point in the history
  • Loading branch information
emestabillo committed Aug 7, 2021
1 parent 1f89611 commit a744328
Show file tree
Hide file tree
Showing 9 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .babelrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
}
]
]
}
}
4 changes: 0 additions & 4 deletions pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ function MyApp({ Component, pageProps, router }) {
<Head>
<title>Planets Fact Site</title>
<meta name="description" content="facts about planets" />
<link
href="https://fonts.googleapis.com/css2?family=Antonio:wght@500&family=Spartan:wght@400;700&display=swap"
rel="stylesheet"
/>
</Head>
<GlobalStyle />
<Layout>
Expand Down
Binary file added public/fonts/antonio-regular-webfont.woff
Binary file not shown.
Binary file added public/fonts/antonio-regular-webfont.woff2
Binary file not shown.
Binary file added public/fonts/spartanmb-bold-webfont.woff
Binary file not shown.
Binary file added public/fonts/spartanmb-bold-webfont.woff2
Binary file not shown.
Binary file added public/fonts/spartanmb-medium-webfont.woff
Binary file not shown.
Binary file added public/fonts/spartanmb-medium-webfont.woff2
Binary file not shown.
31 changes: 31 additions & 0 deletions shared/Globalstyles.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
import { createGlobalStyle } from "styled-components";
import { COLORS } from "../shared/constants";

const Antonio = "/fonts/antonio-regular-webfont.woff";
const Antonio2 = "/fonts/antonio-regular-webfont.woff2";
const SpartanBold = "/fonts/spartanmb-bold-webfont.woff";
const SpartanBold2 = "/fonts/spartanmb-bold-webfont.woff2";
const SpartanMed = "/fonts/spartanmb-medium-webfont.woff";
const SpartanMed2 = "/fonts/spartanmb-medium-webfont.woff2";

const GlobalStyle = createGlobalStyle`
@font-face {
font-family: 'Antonio';
src: url(${Antonio2}) format('woff2'),
url(${Antonio}) format('woff');
font-weight: 500;
font-style: medium;
}
@font-face {
font-family: 'Spartan';
src: url(${SpartanMed2}) format('woff2'),
url(${SpartanMed}) format('woff');
font-weight: 400;
font-style: regular;
}
@font-face {
font-family: 'Spartan';
src: url(${SpartanBold2}) format('woff2'),
url(${SpartanBold}) format('woff');
font-weight: 700;
font-style: bold;
}
*,
*::before,
*::after {
Expand Down

0 comments on commit a744328

Please sign in to comment.