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

fix: design: sets Trebuchet as default font for all USWDS components #971

Merged
merged 14 commits into from
Apr 3, 2023

Conversation

shkeating
Copy link
Contributor

@shkeating shkeating commented Mar 29, 2023

SC-1805

Proposed changes

This branch removes Public Sans and ensures that we instead use Trebuchet MS, the system font as our defualt in all components. Hoping this leads to some gains in performance, as we will no longer be loading additional font file assets in our build aside from Sharp Sans.

image

Also edits our font loading stack to select more similar system fonts to fall back on in the event a user does not have trebuchet

Removes quotes from trebuchet font name, it's uneeded since its a system font

Reviewer notes

This affects almost all USWDS components, we should see a lot of Happo changes.
Some examples: .usa-link, .usa-button, sidenav

Examples of altered components in light mode myspace in screenshots

Setup

yarn dev

Screenshots

Screen Shot 2023-03-29 at 17 08 46-fullpage

@shkeating shkeating requested a review from a team March 29, 2023 21:15
@shkeating shkeating requested a review from a team as a code owner March 29, 2023 21:15
@shkeating shkeating self-assigned this Mar 29, 2023
@shortcut-integration
Copy link

This pull request has been linked to Shortcut Story #1805: Change USWDS theme settings to not use Public Sans.

@shkeating
Copy link
Contributor Author

looks like browsers that are not edge in happo arent showing trebuchet (even tho they do locally). will take a look tomorrow

@shkeating
Copy link
Contributor Author

well, that's not working, going to try to find a different way.

@shkeating shkeating force-pushed the sc-1805-fonts-in-use branch from 693a5f5 to 5c1a349 Compare March 31, 2023 16:52
Copy link
Contributor

@gidjin gidjin left a comment

Choose a reason for hiding this comment

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

LGTM.

Question: should I still see SharpSans fonts get pulled down?

@@ -43,7 +43,8 @@
box-sizing: border-box;
border-radius: 4px;
margin-top: 0;
font-family: 'Trebuchet MS';
font-family: 'Trebuchet MS', Lucida Grande, Lucida Sans Unicode, Lucida Sans,
Copy link
Contributor

Choose a reason for hiding this comment

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

Question: just for my understanding this uses Trebuchet from the user's system because we didn't specify a full path like we do in the storybook files, correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Most computers have trebuchet on them, but it's still a good practice to provide a font stack. In our css modules it will work for both cases. In storybook I loaded in a web font version of trebuchet because happo needs it. If I didn't obtain woff files for it, it would still look right if we run the app or storybook locally, because trebuchet is pre installed on pretty much all Mac and windows computers

The only case where the web fonts are needed is happo. I'm not so pressed about performance and asset loading on storybook as I am with the app itself. I made sure this does not cause the trebuchet files are not loaded in the portal.

@shkeating shkeating merged commit 3654c05 into main Apr 3, 2023
@shkeating shkeating deleted the sc-1805-fonts-in-use branch April 3, 2023 19:55
@gidjin gidjin mentioned this pull request Apr 5, 2023
gidjin added a commit that referenced this pull request Apr 6, 2023
### [4.18.1](4.18.0...4.18.1) (2023-04-05)


### Bug Fixes

* design: adds background fill settings box  ([#973](#973)) ([d63c948](d63c948))
* design: sets Trebuchet as default font for all USWDS components ([#971](#971)) ([3654c05](3654c05))
abbyoung pushed a commit that referenced this pull request Apr 6, 2023
### [4.18.1](4.18.0...4.18.1) (2023-04-05)


### Bug Fixes

* design: adds background fill settings box  ([#973](#973)) ([d63c948](d63c948))
* design: sets Trebuchet as default font for all USWDS components ([#971](#971)) ([3654c05](3654c05))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants