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

8 docs add fonts panda css #9

Merged
merged 4 commits into from
Apr 29, 2024
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
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.