Skip to content

Commit

Permalink
Integrated Nextjs Fonts (#177)
Browse files Browse the repository at this point in the history
Integrated Nextjs font system
  • Loading branch information
ryyu444 authored Aug 28, 2023
1 parent d85049a commit 48bb665
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 26 deletions.
18 changes: 14 additions & 4 deletions src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,17 @@
import '@/styles/globals.scss';
import type { AppProps } from 'next/app';
import { ReactElement } from 'react';
import type { AppProps } from "next/app";
import { ReactElement } from "react";
import { Inter } from "@next/font/google";

const inter = Inter ({
weight: ["400", "700"],
subsets: ["latin"],
variable: "--font-inter",
});

export default function App({ Component, pageProps }: AppProps): ReactElement {
return <Component {...pageProps} />;
return (
<div className={`${inter.variable}`}>
<Component {...pageProps} />
</div>
);
}
9 changes: 9 additions & 0 deletions src/pages/about-us.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import React from 'react';

export default function AboutUs(): React.JSX.Element {
return (
<div>
<h1>About Us</h1>
</div>
);
};
3 changes: 0 additions & 3 deletions src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
import { Inter } from '@next/font/google';
import { ReactElement } from 'react';

const inter = Inter({ subsets: ['latin'] });

export default function Home(): ReactElement {
return (
<div>
Expand Down
2 changes: 2 additions & 0 deletions src/styles/about-us/about-us.modules.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@use 'src/styles/mixins';

25 changes: 6 additions & 19 deletions src/styles/globals.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
@import url('https://fonts.googleapis.com/css2?family=Inter&display=swap');

:root {

// colors
Expand All @@ -14,52 +12,41 @@
--spacer: 48px;
}

h1, h1, h3, h4, p, .p-small, .p-details {
font-family: var(--font-inter);
font-style: normal;
font-weight: 700;
}

h1 {
font-family: 'Inter';
font-size: 7.5rem;
font-style: normal;
font-weight: 400;
}

h2 {
font-family: 'Inter';
font-size: 3.875rem;
font-style: normal;
font-weight: 700;
}

h3 {
font-family: 'Inter';
font-size: 3.25rem;
font-style: normal;
font-weight: 700;
}

h4 {
font-family: 'Inter';
font-size: 2.625rem;
font-style: normal;
font-weight: 700;
}

p {
font-family: 'Inter';
font-size: 2rem;
font-style: normal;
font-weight: 400;
}

.p-small {
font-family: 'Inter';
font-size: 1.5rem;
font-style: normal;
font-weight: 400;
}

.p-details {
font-family: 'Inter';
font-size: 1.125rem;
font-style: normal;
font-weight: 400;
}

Expand Down

0 comments on commit 48bb665

Please sign in to comment.