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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing font face typings #15771

Closed
2 tasks done
trusktr opened this issue May 21, 2019 · 2 comments 路 Fixed by #16639
Closed
2 tasks done

Missing font face typings #15771

trusktr opened this issue May 21, 2019 · 2 comments 路 Fixed by #16639

Comments

@trusktr
Copy link

trusktr commented May 21, 2019

  • This is not a v0.x issue.
  • I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior 馃

Using TypeScript, we should be able to make an array of font faces in a @global @font-face block:

    '@global': {
      '@font-face': [
        {fontFamily: '...', src: '...'},
        {fontFamily: '...', src: '...'}
      ]
    },

but it gives an error:

Current Behavior 馃槸

Screen Shot 2019-05-20 at 11 37 49 PM

If I supply one font family instead of an array of font families, it works fine:

Screen Shot 2019-05-20 at 11 38 57 PM

Steps to Reproduce 馃暪

Link: https://codesandbox.io/embed/createreactappwithtypescript-zg47i

  1. look at src/pages/index.tsx in the styles.

Context 馃敠

I'd like to apply multiple font faces at once, using the standard JSS format (the @font-face can be an array).

Your Environment 馃寧

Tech Version
Material-UI v3.8.3
@trusktr
Copy link
Author

trusktr commented May 21, 2019

As a workaround, I can cast it:

    '@global': {
      '@font-face': [
        {fontFamily: '...', src: '...'},
        {fontFamily: '...', src: '...'}
      ] as unknown as CSSProperties
    },

@trusktr
Copy link
Author

trusktr commented May 21, 2019

related discussion: DefinitelyTyped/DefinitelyTyped#35614

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

Successfully merging a pull request may close this issue.

2 participants