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

CSS Library: Fix font faces being loaded from uswds #3631

Open
4 tasks
micahchiang opened this issue Dec 17, 2024 · 0 comments
Open
4 tasks

CSS Library: Fix font faces being loaded from uswds #3631

micahchiang opened this issue Dec 17, 2024 · 0 comments
Labels
DST-engineering Issues that require work from Design System Team engineers platform-design-system-team

Comments

@micahchiang
Copy link
Contributor

Description

On December 5th the design system team merged in a pull request to swap the import path of core stylesheets in vets-website from Formation to css-library. This change removed a reference to fonts managed in Formation, where USWDS v1 font-faces were imported directly into Formation's core.scss file. Without the presence of this Formation stylesheet, source sans pro fonts were no longer being picked up and included in vets-website's webpack build, which outputs assets to a folder named /generated.

Temporarily, a fonts.scss has been added to vets-website which patches necessary fonts and re-adds them to the /generated folder in a build that gets published from vets-website to S3.

Additionally, css-library makes use of this stylesheet which declares some font-faces and imports others from uswds-fonts. We need to verify how we're using this, as it seems like the imported uswds font-faces aren't actually being used.

Considerations

  • We may not be using @use properly. All @use does is namespace imports, which is distinctly different than what @import does. In order to use the font faces provided by uswds, we probably need to declare font faces and give them a value of whatever we get from uswds.
  • The core issue here is that source sans pro ttf fonts were not being added to /generated, and they need to be. Their presence there can be verified by checking the /generated folder in the build directory of vets-website.
  • More context can be found in this slack thread

Tasks

  • Ensure font-faces are being used properly in css-library/base/fonts.scss when using @use
  • Test changes locally in vets-website using verdaccio. We should be able to publish an updated css-library version to verdaccio that includes changes to /base/fonts.scss. A successful test here is the removal of this vets-website stylesheet and fonts still be added as expected to vets-website/build/localhost/generated
  • Once fonts are successfully being generated given the above, write a follow up task to remove the fonts.scss stylesheet from vets-website. This can be done during the css-library release in which these changes get published to vets-website

Acceptance Criteria

  • above tasks have been completed
@micahchiang micahchiang added the DST-engineering Issues that require work from Design System Team engineers label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DST-engineering Issues that require work from Design System Team engineers platform-design-system-team
Projects
None yet
Development

No branches or pull requests

2 participants