Custom font size in `ThemedLayoutV2`
Where is the font size configured for the
ThemedLayoutV2
component using the Material UI integration? The component is ignoring the font size declared in the typography
object used in the createTheme
object passed as a prop to ThemeProvider
.2 Replies
Hi @Nitai. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Based on the knowledge sources, I can see that you're having an issue with customizing the font size in
ThemedLayoutV2
when using Material UI integration with refine.
When customizing typography in Material UI with refine, there appears to be a specific way to properly override the font family (and by extension, font sizes). According to the documentation and a reported issue, you need to recreate the theme using createTheme
and properly structure your typography options.
The issue you're experiencing might be similar to what was reported in this GitHub issue, where simply overriding typography properties wasn't working correctly.
Here's how you should properly configure font sizes (and other typography properties) for ThemedLayoutV2
:
Then pass this custom theme to the ThemeProvider
:
If this approach doesn't work, you might need to use the "swizzle" feature to customize the ThemedLayoutV2
component directly. As mentioned in the Customizing with swizzle section, you can eject the component's source code to your project and modify it directly.
The swizzle command will create a copy of the component in your project's src
directory, allowing you to customize it according to your specific needs, including font sizes that might be hardcoded in the component.
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------<@1091820430047838349> Kapa.ai is still learning and improving, please let me know how I did by reacting below.