Skip to content

Commit

Permalink
Merge pull request #16 from reednel/develop
Browse files Browse the repository at this point in the history
test font hosting
  • Loading branch information
Reed Nelson committed Aug 13, 2023
2 parents 1951967 + f513e8f commit 4ce2897
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added public/fonts/eb-garamond/eb-garamond-500.woff2
Binary file not shown.
Binary file added public/fonts/eb-garamond/eb-garamond-700.woff2
Binary file not shown.
2 changes: 1 addition & 1 deletion src/config/theme.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
"font_family": {
"primary": "Calibri:wght@400;600",
"primary_type": "sans-serif",
"secondary": "Garamond:wght@500;700",
"secondary": "EB Garamond:wght@500;700",
"secondary_type": "sans-serif"
},
"font_size": {
Expand Down
19 changes: 12 additions & 7 deletions src/layouts/Base.astro
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,19 @@ const { title, meta_title, description, image, noindex, canonical } =
<meta name="generator" content={Astro.generator} />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<!-- google font css -->
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
href={`https://fonts.googleapis.com/css2?family=${pf}${
sf ? "&family=" + sf : ""
}&display=swap`}
rel="stylesheet"
rel="preload"
href="/fonts/eb-garamond/eb-garamond-500.woff2"
as="font"
type="font/woff2"
crossorigin
/>
<link
rel="preload"
href="/fonts/eb-garamond/eb-garamond-700.woff2"
as="font"
type="font/woff2"
crossorigin
/>

<!-- responsive meta -->
Expand Down
18 changes: 18 additions & 0 deletions src/styles/base.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,21 @@
/* eb-garamond-500 */
@font-face {
font-display: block;
font-family: 'EB Garamond';
font-style: normal;
font-weight: 500;
src: url('/fonts/eb-garamond/eb-garamond-700.woff2') format('woff2');
}

/* eb-garamond-700 */
@font-face {
font-display: block;
font-family: 'EB Garamond';
font-style: normal;
font-weight: 700;
src: url('/fonts/eb-garamond/eb-garamond-700.woff2') format('woff2');
}

html {
@apply text-base h-screen;
}
Expand Down

0 comments on commit 4ce2897

Please sign in to comment.