question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Link with `component=button` does not use custom font

See original GitHub issue

Duplicates

  • I have searched the existing issues

Latest version

  • I have tested the 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 font

Expected behavior 🤔

Link should always use the custom font

Steps to reproduce 🕹

https://codesandbox.io/s/vigorous-chihiro-mf2h6k?file=/src/Demo.tsx

Context 🔦

No response

Your environment 🌎

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jhon-rayocommented, Jul 23, 2022

I will work on this and put up a PR if that’s fine

1reaction
oliviertassinaricommented, Jun 22, 2022

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>
  );
}
Screenshot 2022-06-22 at 14 30 25

https://codesandbox.io/s/xenodochial-stitch-wpjcqk?file=/src/Demo.tsx

We could fix this 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Custom font not applying React Native Elements Button ...
I am using "react-native-elements": "^0.19.1" version and trying to set custom font for the button. Already the font is working in the page ......
Read more >
3 ways to add custom fonts to your MUI project - LogRocket Blog
Learn three simple ways to add custom fonts to a MUI project, including the Google Fonts CDN, google-webfonts-helper, and npm.
Read more >
How to use custom fonts in Material-UI - WebDevAssist
In this post, I will show you how to add one custom font in Material-UI with ... the link, open public/index.html and put...
Read more >
3 quick ways to add fonts to your React app - GreenRoots Blog
const FontLink = () => { return( <div className="card"> <span className="font-link"> This is with Font Link. We are linking the fonts from the...
Read more >
React Typography component - Material UI - MUI
The Roboto font will not be automatically loaded by MUI. You are responsible for loading any fonts used in your application. Roboto Font...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found