Skip to content

Commit 50d8783

Browse files
committed
Custom font
1 parent 46d6c63 commit 50d8783

File tree

4 files changed

+44
-9
lines changed

4 files changed

+44
-9
lines changed

components/CenterContainer.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ const InnerContainer = styled.div`
1212
`;
1313

1414
const OuterContainer = styled.div`
15-
max-width: 1300px;
16-
width: 1300px;
15+
max-width: 1175px;
16+
width: 1175px;
1717
`;
1818

1919
export function CenterContainer({ children, ...rest }: React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>) {

pages/_app.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
import "../styles/globals.css";
22

3+
// https://stackoverflow.com/questions/57609931/next-js-with-fortawesome-and-ssr
4+
import { config } from "@fortawesome/fontawesome-svg-core";
5+
import "@fortawesome/fontawesome-svg-core/styles.css"; // Import the CSS
6+
config.autoAddCss = false; // Tell Font Awesome to skip adding the CSS automatically since it's being imported above
7+
38
function MyApp({ Component, pageProps }) {
49
return <Component {...pageProps} />;
510
}

pages/docs/[doc].tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import styled from "styled-components";
1010
import { Prism as SyntaxHighlighter } from "react-syntax-highlighter";
1111
import { materialOceanic } from "react-syntax-highlighter/dist/cjs/styles/prism";
1212
import Link from "next/link";
13+
import Head from "next/head";
1314

1415
const ARTICLES_PATH = path.join(process.cwd(), "articles");
1516

@@ -41,11 +42,30 @@ const ReactMarkdownContainer = styled.div`
4142
margin: 2em 0;
4243
border: 1px solid #0002;
4344
}
45+
46+
h1,
47+
h2,
48+
h3,
49+
h4,
50+
h5,
51+
h6 {
52+
margin: 1.2em 0 0.5em 0;
53+
}
54+
55+
h1,
56+
h2 {
57+
padding-bottom: 0.2em;
58+
border-bottom: 1px solid #0002;
59+
}
4460
`;
4561

4662
export default function DocPage(props: Props) {
4763
return (
4864
<>
65+
<Head>
66+
<link rel="preconnect" href="https://fonts.gstatic.com" />
67+
<link href="https://fonts.googleapis.com/css2?family=Open+Sans&family=Roboto&display=swap" rel="stylesheet" />
68+
</Head>
4969
<NavBar />
5070
<CenterContainer style={{ margin: "2em 0.5em" }}>
5171
<Container>

styles/globals.css

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,26 @@
11
html,
22
body {
3-
padding: 0;
4-
margin: 0;
5-
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
6-
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
3+
padding: 0;
4+
margin: 0;
5+
font-family: "Roboto", sans-serif;
6+
/* font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
7+
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; */
78
}
89

910
a {
10-
color: inherit;
11-
text-decoration: none;
11+
color: inherit;
12+
text-decoration: none;
1213
}
1314

1415
* {
15-
box-sizing: border-box;
16+
box-sizing: border-box;
17+
}
18+
19+
h1,
20+
h2,
21+
h3,
22+
h4,
23+
h5,
24+
h6 {
25+
font-family: "Open Sans", sans-serif;
1626
}

0 commit comments

Comments
 (0)