Skip to content

Commit

Permalink
Merge pull request #9 from omnifed/8-docs-add-fonts-panda-css
Browse files Browse the repository at this point in the history
8 docs add fonts panda css
  • Loading branch information
caseybaggz authored Apr 29, 2024
2 parents e552d9c + a06c921 commit 7af7af2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
19 changes: 11 additions & 8 deletions docs/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,25 @@
import type { Metadata } from 'next'
import { Inter } from 'next/font/google'
import { Poppins } from 'next/font/google'
import type { PropsWithChildren } from 'react'
import './globals.css'

const inter = Inter({ subsets: ['latin'] })
const poppins = Poppins({
display: 'swap',
subsets: ['latin'],
weight: ['400', '600', '700', '800'],
})

export const metadata: Metadata = {
title: 'Create Next App',
description: 'Generated by create next app',
}

export default function RootLayout({
children,
}: Readonly<{
children: React.ReactNode
}>) {
interface RootProps {}

export default function RootLayout(props: PropsWithChildren<RootProps>) {
return (
<html lang="en">
<body className={inter.className}>{children}</body>
<body className={poppins.className}>{props.children}</body>
</html>
)
}
1 change: 1 addition & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@types/node": "^20",
"@types/react": "^18",
"@types/react-dom": "^18",
"@cerberus-design/panda-preset": "workspace:*",
"eslint": "8.57.0",
"eslint-config-next": "14.2.3"
}
Expand Down
12 changes: 12 additions & 0 deletions packages/panda-preset/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,18 @@ export default defineConfig({
- [Semantic Tokens](./src/theme/semanticTokens/index.ts)
- [Recipes](./src/recipes/index.ts)

## NextJS Font Features

If you use NextJS, we recommend the font and settings mentioned below. Unfortunately, NextJS enforces a rule of `Font loader values must be explicitly written literals.` which means you cannot use a variable to define the font settings or else we would also provide that. :sob:

```typescript
const poppins = Poppins({
display: 'swap',
subsets: ['latin'],
weight: ['400', '600', '700', '800'],
})
```

---

_Copyright (c) 2024 Digital University, All Rights Reserved_
3 changes: 3 additions & 0 deletions pnpm-lock.yaml

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

0 comments on commit 7af7af2

Please sign in to comment.