diff --git a/package.json b/package.json index 0c1001d..09c7810 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ "clsx": "^2.0.0", "cmdk": "^0.2.0", "framer-motion": "^10.16.16", + "geist": "^1.2.0", "lodash": "^4.17.21", "next": "14.0.4", "next-intl": "3.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6f9506d..0bb3541 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -35,6 +35,9 @@ dependencies: framer-motion: specifier: ^10.16.16 version: 10.16.16(react-dom@18.2.0)(react@18.2.0) + geist: + specifier: ^1.2.0 + version: 1.2.0(next@14.0.4) lodash: specifier: ^4.17.21 version: 4.17.21 @@ -2761,6 +2764,14 @@ packages: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} dev: true + /geist@1.2.0(next@14.0.4): + resolution: {integrity: sha512-RZsgCkGnSi1IV1Ozg3s6Ou4r/jzLff9+47ChjpJ5yX8ncEC/RwdStGwhdFzDcnSv0xU0+9J/fTX5Kht0NajTXA==} + peerDependencies: + next: ^13.2 || ^14 + dependencies: + next: 14.0.4(react-dom@18.2.0)(react@18.2.0) + dev: false + /get-intrinsic@1.2.1: resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==} dependencies: diff --git a/public/fonts/SarasaGothic/sarasa-gothic-tc-bold.ttf b/public/fonts/SarasaGothic/sarasa-gothic-tc-bold.ttf deleted file mode 100644 index a06d774..0000000 Binary files a/public/fonts/SarasaGothic/sarasa-gothic-tc-bold.ttf and /dev/null differ diff --git a/public/fonts/SarasaGothic/sarasa-gothic-tc-light.ttf b/public/fonts/SarasaGothic/sarasa-gothic-tc-light.ttf deleted file mode 100644 index c908815..0000000 Binary files a/public/fonts/SarasaGothic/sarasa-gothic-tc-light.ttf and /dev/null differ diff --git a/public/fonts/SarasaGothic/sarasa-gothic-tc-regular.ttf b/public/fonts/SarasaGothic/sarasa-gothic-tc-regular.ttf deleted file mode 100644 index b3f24dd..0000000 Binary files a/public/fonts/SarasaGothic/sarasa-gothic-tc-regular.ttf and /dev/null differ diff --git a/public/fonts/SarasaGothic/sarasa-gothic-tc-semibold.ttf b/public/fonts/SarasaGothic/sarasa-gothic-tc-semibold.ttf deleted file mode 100644 index ce4837b..0000000 Binary files a/public/fonts/SarasaGothic/sarasa-gothic-tc-semibold.ttf and /dev/null differ diff --git a/src/app/[locale]/layout.tsx b/src/app/[locale]/layout.tsx index 06c9aeb..782a650 100644 --- a/src/app/[locale]/layout.tsx +++ b/src/app/[locale]/layout.tsx @@ -1,16 +1,19 @@ import '@/constants/globals.css' import type { Metadata } from 'next' +import { Noto_Sans_TC } from 'next/font/google' import { notFound } from 'next/navigation' import { getTranslations, unstable_setRequestLocale } from 'next-intl/server' +import { GeistSans } from 'geist/font/sans' import Providers from '@/components/providers' import Sidebar from '@/components/sidebar' -import { sarasa_gothic, work_sans } from '@/constants/fonts' import { locales } from '@/lib/i18n' import type { Locale } from '@/lib/types' import { cn } from '@/lib/utils' +const NotoSansTC = Noto_Sans_TC({ variable: '--font-noto-sans-tc', subsets: ['latin'] }) + interface RootLayoutProps { children: React.ReactNode params: { locale: Locale } @@ -42,9 +45,8 @@ export default function RootLayout({ children, params: { locale } }: RootLayoutP unstable_setRequestLocale(locale) return ( - - - + +
diff --git a/src/constants/fonts.ts b/src/constants/fonts.ts deleted file mode 100644 index c84502d..0000000 --- a/src/constants/fonts.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { Work_Sans } from 'next/font/google' -import localFont from 'next/font/local' - -export const work_sans = Work_Sans({ - subsets: ['latin'], - weight: ['400', '500', '600', '700'], - variable: '--ff-work-sans', -}) - -export const sarasa_gothic = localFont({ - src: [ - { - path: '../../public/fonts/SarasaGothic/sarasa-gothic-tc-light.ttf', - weight: '300', - style: 'normal', - }, - { - path: '../../public/fonts/SarasaGothic/sarasa-gothic-tc-regular.ttf', - weight: '400', - style: 'normal', - }, - { - path: '../../public/fonts/SarasaGothic/sarasa-gothic-tc-semibold.ttf', - weight: '600', - style: 'normal', - }, - { - path: '../../public/fonts/SarasaGothic/sarasa-gothic-tc-bold.ttf', - weight: '700', - style: 'normal', - }, - ], - variable: '--ff-sarasa-gothic-tc', -}) diff --git a/tailwind.config.js b/tailwind.config.js index 798e9f7..b80df6f 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,3 +1,5 @@ +const { fontFamily } = require('tailwindcss/defaultTheme') + /** @type {import('tailwindcss').Config} */ module.exports = { content: ['./src/**/*.{ts,tsx}'], @@ -5,10 +7,10 @@ module.exports = { theme: { extend: { fontFamily: { - main: [ - 'var(--ff-work-sans)', - 'var(--ff-sarasa-gothic-tc)', - 'sans-serif', + sans: [ + 'var(--font-geist-sans)', + 'var(--font-noto-sans-tc)', + ...fontFamily.sans, ], }, },