Skip to content
This repository was archived by the owner on Sep 30, 2024. It is now read-only.

Svelte: use Inter font for --font-family-base#63221

Merged
camdencheek merged 6 commits into
mainfrom
cc/inter-font
Jun 12, 2024
Merged

Svelte: use Inter font for --font-family-base#63221
camdencheek merged 6 commits into
mainfrom
cc/inter-font

Conversation

@camdencheek

@camdencheek camdencheek commented Jun 12, 2024

Copy link
Copy Markdown
Member

This adds Inter as the preferred for --font-family-base in the Svelte webapp. Previously, we were using system fonts for our base font, which meant our web app looked different depending on the OS+browser.

Instead of depending on the Google Fonts CDN, this uses Fontsource, which let us easily self-host Google Fonts (and other OSS fonts) just by importing an NPM package. No committing font files to git, and no dependency or connection to a 3rd-party server. The font itself weighs ~40KB for the full, variable-weight font.

Contributes to SRCH-445

Test plan

pnpm dev and sg start, inspect element to ensure that we were rendering the new font, and check the network tab to ensure we weren't hitting the CDN and that the font wasn't super large. The

@cla-bot cla-bot Bot added the cla-signed label Jun 12, 2024
@github-actions

Copy link
Copy Markdown
Contributor

Caution

License checking failed, please read: how to deal with third parties licensing.

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

Caution

License checking failed, please read: how to deal with third parties licensing.

@camdencheek camdencheek changed the title Svelte: use inter font for --font-family-base Svelte: use Inter font for --font-family-base Jun 12, 2024
Comment on lines +618 to +623
- - :permit
- OFL-1.1
- :who:
:why: Safe open font license
:versions: []
:when: 2024-06-12 01:39:30.854523000 Z

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the OFL license to the list of allowed licenses. This is not a risky license, we are not modifying the font, and we are distributing the license with our list of OSS dependencies.

@camdencheek camdencheek marked this pull request as ready for review June 12, 2024 02:18
@camdencheek camdencheek requested a review from a team June 12, 2024 02:18

@fkling fkling left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not super familiar with fonts, but these changes seem pretty straightforward.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we importing this anywhere?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh whoops. Leftover from a different attempt.

@camdencheek camdencheek enabled auto-merge (squash) June 12, 2024 13:30
@camdencheek camdencheek merged commit 3789779 into main Jun 12, 2024
@camdencheek camdencheek deleted the cc/inter-font branch June 12, 2024 13:41
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants