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

feat: Next 13 global fonts #2313

Merged
merged 5 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from 4 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
12 changes: 0 additions & 12 deletions packages/core/.babelrc.js

This file was deleted.

1 change: 0 additions & 1 deletion packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ A quick look at the top-level files and directories you'll see in a this NextJS
├── public
├── src
├── test
├── .babelrc.js
├── .editorconfig
├── .prettierignore
├── .prettierrrc
Expand Down
16 changes: 10 additions & 6 deletions packages/core/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ import ThirdPartyScripts from 'app/components/ThirdPartyScripts'
import AnalyticsHandler from 'app/sdk/analytics'
import ErrorBoundary from 'app/sdk/error/ErrorBoundary'
import UIProvider from 'app/sdk/ui/UIProvider'
import { WebFonts } from 'src/customizations/src/GlobalOverrides'

// TODO: The path will probably change when overriding fonts in the future
import DefaultFont from 'app/styles/fonts'

// import GlobalSections from './components/cms/GlobalSections'

Expand Down Expand Up @@ -78,11 +80,13 @@ export default async function RootLayout({
<AnalyticsHandler />

<html>
<head>
{!process.env.DISABLE_3P_SCRIPTS && <ThirdPartyScripts />}
<WebFonts />
</head>
<body className="theme">
eduardoformiga marked this conversation as resolved.
Show resolved Hide resolved
<head>{!process.env.DISABLE_3P_SCRIPTS && <ThirdPartyScripts />}</head>
{/**
* TODO: Later when overriding fonts we should use the font variable in CSS files
* https://nextjs.org/docs/app/api-reference/components/font#css-variables
*/}
<body className={`theme ${DefaultFont.className}`}>
FS Next Update page using Inter font.
<UIProvider>
<>
{/* <GlobalSections {...globalSections}>{children}</GlobalSections>*/}
Expand Down
10 changes: 10 additions & 0 deletions packages/core/app/styles/fonts/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { Inter } from 'next/font/google'
eduardoformiga marked this conversation as resolved.
Show resolved Hide resolved

const customFont = Inter({
display: 'swap',
variable: '--fs-font-inter',
weight: ['400', '500', '600', '700', '900'],
subsets: ['latin'], // Either define subsets or set preload to false https://nextjs.org/docs/messages/google-fonts-missing-subsets
})

export default customFont
Loading