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(PPDSC-2480): load correct font urls #448

Merged
merged 3 commits into from
Nov 3, 2022
Merged

Conversation

mstuartf
Copy link
Contributor

@mstuartf mstuartf commented Nov 1, 2022

PPDSC-2480

What

  1. Background - why this is needed
    Font file not loading for Virgin so incorrect font displaying in Storybook theme checker
  2. What did you do
  • Old Montserrat font link was invalid
  • Instead of hardcoding the new one, add a link element to load a stylesheet that imports the fonts
  • This matches what Virgin do on their site
  1. What does the reviewers should expect
    Virgin fonts display correctly in theme checker

I have done:

  • Written unit tests against changes
  • Written functional tests against the component and/or NewsKit site
  • Updated relevant documentation

I have tested manually:

  • The feature's functionality is working as expected on Chrome, Firefox, Safari and Edge
  • The screen reader reads and flows through the elements as expected.
  • There are no new errors in the browser console coming from this PR.
  • When visual test is not added, it renders correctly on different browsers and mobile viewports (Safari, Firefox, small mobile viewport, tablet)
  • The Playground feature is working as expected

Before:

After:

Who should review this PR:

How to test:

- Old Montserrat font link was invalid
- Instead of hardcoding the new one, add a link element to load a stylesheet that imports the fonts
- This matches what Virgin do on their site
@mstuartf mstuartf added the draft This is a draft PR and not intended for formal review yet label Nov 1, 2022
@github-actions github-actions bot added the fix This change fixes a bug label Nov 1, 2022
@newskit-engineering
Copy link
Collaborator

@mstuartf mstuartf added ready for review Please assist in getting this reviewed and removed draft This is a draft PR and not intended for formal review yet labels Nov 1, 2022
Comment on lines +334 to +337
<link
rel='stylesheet'
href='https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,400;0,600;0,700;1,400;1,700&amp;display=swap'
/>
Copy link
Contributor

Choose a reason for hiding this comment

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

to me personally, that's the simplest solution!

Copy link
Contributor

Choose a reason for hiding this comment

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

Pretty neat. How did you find this? @mstuartf

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I looked at the Virgin site and that's how they load their fonts there. I think the reason that this stopped working is that the old google fonts url was out of date / invalid. But this way we shouldn't have this problem again.

@mstuartf mstuartf merged commit 15602d9 into main Nov 3, 2022
@mstuartf mstuartf deleted the fix/PPDSC-2480-virgin-fonts branch November 3, 2022 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fix This change fixes a bug ready for review Please assist in getting this reviewed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants