-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
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
Link with component=button
does not use custom font
#32942
Comments
The problem here is that the Link component does not explicitly set its .MuiLink-button {
font-family: inherit;
} I'm not keen on setting this in the library at this point, as this can cause an unexpected change of fonts in many applications. |
From my perspective, it's a support question. We document this here: https://mui.com/material-ui/react-link/ It was designed so the correct approach is: <Link component="button" variant="body1">This is not good (it's Ariel)</Link> https://codesandbox.io/s/elegant-cray-zv1x60?file=/src/Demo.tsx |
However, there is a broader question (not directly surfaced in this issue that Michal raised), we say variant: "inherit", but it doesn't truly inherit: export default function Demo() {
return (
<ThemeProvider theme={theme}>
<Typography variant="body1">
<CssBaseline />
<Link>This is good (it's Inconsolata)</Link>
<br />
<Link component="button">This is not good (it's Ariel)</Link>
</Typography>
</ThemeProvider>
);
} https://codesandbox.io/s/xenodochial-stitch-wpjcqk?file=/src/Demo.tsx We could fix this 👍 |
I'm happy to accept a PR for this issue. |
I will work on this and put up a PR if that's fine |
Any movement on this one? Seems to still be an issue |
Duplicates
Latest version
Current behavior 😯
When adding a custom font all components work well (like Typography Link and Button)
But when using
<Link component="button">Hi</Link>
it uses default fontExpected behavior 🤔
Link
should always use the custom fontSteps to reproduce 🕹
https://codesandbox.io/s/distracted-wind-jjxdxm?file=/src/Demo.tsx
Context 🔦
No response
Your environment 🌎
Material UI v5.11.0
The text was updated successfully, but these errors were encountered: