Skip to content

Commit

Permalink
Load IBM fonts via Google Fonts (#241)
Browse files Browse the repository at this point in the history
Unless you already had IBM's fonts installed locally, they would not be
used. For example, this is how the docs look for me:

![Screenshot 2023-03-31 at 12 49 10
PM](https://user-images.githubusercontent.com/14852634/229204915-4314ef87-bd70-4923-8b1a-9a851e8fd9a2.png)

After, with this PR:

![Screenshot 2023-03-31 at 12 48 36
PM](https://user-images.githubusercontent.com/14852634/229204795-401aea5c-597b-44c6-8452-bbf295902f9d.png)

We can solve this by using Google Fonts and a CSS import. 

## Why Google Fonts?

We could also try distributing the font directly. I don't have an
informed opinion here; ChatGPT suggests benefits of Google Fonts include
ease of use & leveraging their CDN.
  
## Why these font-weights?

Font weight gets set by the CSS rule `font-weight:`. So, I searched all
font-weights we set. We legitimately use 400, 500, 600, and 700.

While our CSS also has 300, that CSS looks dead to me based on grepping
`_build/html` in the docs sample build.

When we don't include a font-weight, the browser falls back to the
nearest weight. So, 300 will fall back to 400. For italics, the browser
will try to italicize the font for you if there is no font—but this is
actually a bad experience.

The downside of including more font variants is that it increases the
file size to download our site, which slows down performance, especially
with slow Internet.

---------

Co-authored-by: Abby Mitchell <23662430+javabster@users.noreply.github.com>
  • Loading branch information
Eric-Arellano and javabster authored Apr 7, 2023
1 parent f9109b5 commit eaa076a
Showing 1 changed file with 33 additions and 25 deletions.
58 changes: 33 additions & 25 deletions qiskit_sphinx_theme/pytorch_base/static/css/theme.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit eaa076a

Please sign in to comment.