[react] Editors use `fontFamily: '"Fira Code"'` with no fallback

Open Beginner friendly
#4,772 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
react, typescript

Research direction

Start by reading createEditor in @graphiql/react and comparing its editor font setting with the font declarations in graphiql/style.css and @graphiql/react/style.css; issue #4058 gives context on the per-package stylesheets. Check how Monaco's default font is set in tests or examples. Done when editors using the per-package stylesheet display a monospace fallback without requiring Fira Code to be installed, or the font can be configured.

Written by the indexing model from the issue text.

Description

createEditor in @graphiql/react 1.0.2 sets fontFamily: '"Fira Code"' for every Monaco editor, with no fallback. The Fira Code @font-face only ships in graphiql/style.css; @graphiql/react/style.css has none.

So apps that import the per-package stylesheets (to skip the ~500KB of inlined fonts, as discussed in #4058) and don't load Fira Code themselves get the browser's default font in the editors, usually a serif one, unless Fira Code happens to be installed locally.

Could the default include a fallback (e.g. "Fira Code", ui-monospace, monospace, or var(--font-family-mono)), or be configurable? For now we set Monaco's default font on the editors after they're created.

Dominant language
TypeScript
Stars
16.9k
Forks
1.9k
Avg merge
14h 1m
Merged PRs (30d)
81

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from graphql/graphiql

All issues in graphql/graphiql

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.