Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace fonts loaded via stylesheet with use of next/font #2600

Merged
merged 6 commits into from
Apr 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions website/package-lock.json

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

2 changes: 1 addition & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"@marsidev/react-turnstile": "^0.0.7",
"@next-auth/prisma-adapter": "^1.0.5",
"@next/bundle-analyzer": "^13.2.4",
"@next/font": "^13.2.4",
"@next/font": "13.0.6",
spencerwmiles marked this conversation as resolved.
Show resolved Hide resolved
"@nikolovlazar/chakra-ui-prose": "^1.2.1",
"@prisma/client": "^4.11.0",
"@tailwindcss/forms": "^0.5.3",
Expand Down
Binary file removed website/public/fonts/Inter-italic.var.woff2
Binary file not shown.
Binary file removed website/public/fonts/Inter-roman.var.woff2
Binary file not shown.
2 changes: 1 addition & 1 deletion website/src/components/Header/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ export function Header({ preLogoSlot }: HeaderProps) {
{preLogoSlot}
<Flex as={Link} gap="3" href={homeURL} aria-label="Home" alignItems="center">
<Image src="/images/logos/logo.svg" className="mx-auto object-fill" width="50" height="50" alt="logo" />
<Text fontFamily="inter" fontSize={["lg", "2xl"]} fontWeight="bold" className="hidden sm:block">
<Text fontSize={["lg", "2xl"]} fontWeight="bold" className="hidden sm:block">
{t("title")}
</Text>
</Flex>
Expand Down
1 change: 0 additions & 1 deletion website/src/components/SideMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export function SideMenu({ items, collapsed }: SideMenuProps) {
return (
<Tooltip
key={item.labelID}
fontFamily="inter"
label={label}
placement="right"
className={clsx("hidden sm:block", { "lg:hidden": !collapsed })}
Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/privacy-policy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const PrivacyPolicy = () => {
<title>Privacy Policy - Open Assistant</title>
<meta name="description" content="Open Assistant's Privacy Policy" />
</Head>
<Box fontFamily="Inter" p="6" className="oa-basic-theme">
<Box p="6" className="oa-basic-theme">
<Box className="max-w-4xl mx-auto">
<Stack spacing="6" mb="6">
<Heading as="h1" size="xl" color="blue.500">
Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/team.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Team = () => {
<title>{`${t("who_are_we")} - Open Assistant`}</title>
<meta name="description" content="The team behind Open Assistant" />
</Head>
<Box fontFamily="Inter" p="6" className="oa-basic-theme">
<Box p="6" className="oa-basic-theme">
<Stack className="max-w-6xl mx-auto" spacing="6" mb="6">
<Heading as="h1" size="xl" color="blue.500">
{t("who_are_we")}
Expand Down
2 changes: 1 addition & 1 deletion website/src/pages/terms-of-service.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const TermsOfServicePage = () => {
<title>Terms of Service - Open Assistant</title>
<meta name="description" content="Open Assistant's Terms of Service" />
</Head>
<Box fontFamily="Inter" p="6" className="oa-basic-theme">
<Box p="6" className="oa-basic-theme">
<Box className="max-w-4xl mx-auto">
<Heading as="h1" size="xl" color="blue.500" mb="6">
Terms of Service
Expand Down
7 changes: 5 additions & 2 deletions website/src/styles/Theme/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import { badgeTheme } from "./components/Badge";
import { cardTheme } from "./components/Card";
import { containerTheme } from "./components/Container";
import { tableTheme } from "./components/Table";
import { Inter } from "@next/font/google";

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

const config: ThemeConfig = {
initialColorMode: "light",
Expand All @@ -30,8 +33,8 @@ const breakpoints = {
};

const fonts = {
heading: "Inter",
body: "Inter",
heading: inter.style.fontFamily,
body: inter.style.fontFamily,
};

const styles: Styles = {
Expand Down
18 changes: 0 additions & 18 deletions website/src/styles/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,6 @@
@tailwind components;
@tailwind utilities;

@font-face {
font-family: "Inter";
font-weight: 100 900;
font-display: block;
font-style: normal;
font-named-instance: "Regular";
src: url("/fonts/Inter-roman.var.woff2") format("woff2");
}

@font-face {
font-family: "Inter";
font-weight: 100 900;
font-display: block;
font-style: italic;
font-named-instance: "Italic";
src: url("/fonts/Inter-italic.var.woff2") format("woff2");
}

#__next {
min-height: 100%;
}