Commit 8cab2595 authored by tom's avatar tom

add font in theme config

parent 8ab8cf0a
import React from 'react';
import type { AppProps } from 'next/app';
import { ChakraProvider } from '@chakra-ui/react';
import theme from '../theme/index';
function MyApp({ Component, pageProps }: AppProps) {
return (
<ChakraProvider>
<ChakraProvider theme={ theme }>
<Component { ...pageProps }/>
</ChakraProvider>
);
......
import React from 'react';
import Document, { Html, Head, Main, NextScript } from 'next/document'
class MyDocument extends Document {
render() {
return (
<Html>
<Head>
<link
href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap"
rel="stylesheet"
/>
</Head>
<body>
<Main/>
<NextScript/>
</body>
</Html>
)
}
}
export default MyDocument
import { theme } from '@chakra-ui/react';
const fonts = {
heading: `Inter, ${ theme.fonts.heading }`,
body: `Inter, ${ theme.fonts.body }`,
}
export default fonts;
import { extendTheme } from '@chakra-ui/react';
import fonts from './fonts';
const overrides = {
fonts,
}
export default extendTheme(overrides);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment