change the typography font of refine next app
I need to change the typography text in my app but i m not sure that i should to change it in theme using antdesign
ConfigProvider component. Below is an example of how you can override the typography settings in your theme:ConfigProvider component is used to customize the theme, including the typography settings. The property is set to a custom font stack.createTheme. Here is an example:createTheme. Below is an example of how you can achieve this:index.html:These are the Integration which i wanna see in future of refine:
- UI Lib: Shadcn, NextUI.
- Data/Live Provider: PocketBase.
- Auth Providers: Next-Auth/Auth.js
Hello @AriaFantom, thanks for the suggestions! We are open to contributions for any integration from the community.
We already have NextAuth example, you can see it here: https://refine.dev/docs/examples/next-js/NextAuth-js/
fontFamilyThemeProviderimport { Refine } from "@refinedev/core";
import { ThemedLayoutV2 } from "@refinedev/antd";
import { ConfigProvider } from "antd";
const App: React.FC = () => {
return (
<ConfigProvider
theme={{
components: {
Typography: {
colorTextHeading: "#1890ff", // Example of changing text color
},
},
token: {
fontFamily: "Montserrat, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, 'sans-serif', 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol'", // Custom font family
},
}}
>
<Refine
/* ... */
>
<ThemedLayoutV2>{/* ... */}</ThemedLayoutV2>
</Refine>
</ConfigProvider>
);
}; import { TypographyVariantsOptions, createTheme } from "@mui/material/styles";
const typographyOptions: TypographyVariantsOptions = {
fontFamily: [
"Montserrat",
"-apple-system",
"BlinkMacSystemFont",
'"Segoe UI"',
"Roboto",
'"Helvetica Neue"',
"Arial",
"sans-serif",
'"Apple Color Emoji"',
'"Segoe UI Emoji"',
'"Segoe UI Symbol"',
].join(","),
};import { RefineThemes } from "@refinedev/mui";
const overriddenLightTheme = createTheme({
...RefineThemes.Blue,
typography: {
...typographyOptions,
},
});import { ThemeProvider } from "@mui/material/styles";
import { Refine } from "@refinedev/core";
import { ThemedLayoutV2 } from "@refinedev/mui";
const App: React.FC = () => {
return (
<ThemeProvider theme={overriddenLightTheme}>
<Refine>
<ThemedLayoutV2>{/* ... */}</ThemedLayoutV2>
</Refine>
</ThemeProvider>
);
};<!DOCTYPE html>
<html lang="en">
<head>
<link
href="<https://fonts.googleapis.com/css2?family=Montserrat:wght@100;200;300;400;500;600;700;800;900&display=swap">
rel="stylesheet"
/>
<title>Refine adding font family example</title>
</head>
<body>
...
</body>
</html>