Skip to content
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

Trouble Loading Custom Font Into Shadow DOM in my Chrome Extension #139

Open
lancesnider opened this issue Aug 31, 2022 · 0 comments
Open

Comments

@lancesnider
Copy link

I'm having trouble loading my custom font into my Chrome Extension.

// index.js
<root.div>
  <style dangerouslySetInnerHTML={{ __html: stylesheet }} />
  <App />
</root.div>
@font-face {
    font-family: 'defaultText';
    src: url('chrome-extension://' + $extensionId + '/Inter-Regular.woff2')
        format('woff2'),
      url('chrome-extension://' + $extensionId + '/Inter-Regular.woff')
        format('woff');
  }

.some-class {
  // I set the fallback font to serif so it's easy to catch
  font-family: 'defaultText', serif;
}

Here's the style tag that gets put inside my shadow. I've tested those urls and the font is there.

Screen Shot 2022-08-31 at 11 47 57 AM

If I change <root.div> to <div> the fonts load properly.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant