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

feat(styles): load custom fonts #603

Merged
merged 2 commits into from
Jun 3, 2020
Merged

feat(styles): load custom fonts #603

merged 2 commits into from
Jun 3, 2020

Conversation

connor-baer
Copy link
Member

@connor-baer connor-baer commented Jun 2, 2020

Purpose

When we started Circuit UI 2 years ago, I researched different font loading techniques. We decided to leave the font loading to the applications to give them the flexibility to control the loading behavior (FOIT vs FOUT etc). The ideal approach requires <link /> tags in the <head />, the API to inject those depends on the application (SSR and all). So we just documented it in Storybook.

Nowadays, the font-display CSS property has decent browser support, so we can standardize it and automatically load the fonts.

Approach and changes

  • migrate BaseStyles to TypeScript
  • add font-face declarations to BaseStyles

Definition of done

  • Development completed
  • Reviewers assigned
  • Unit and integration tests
  • Meets minimum browser support
  • Meets accessibility requirements

@connor-baer connor-baer added the feature A new feature or enhancement label Jun 2, 2020
@connor-baer connor-baer added this to the v2.0 milestone Jun 2, 2020
@vercel
Copy link

vercel bot commented Jun 2, 2020

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/sumup-oss/circuit-ui/oqco64795
✅ Preview: https://circuit-ui-git-feature-load-fonts.sumup-oss.now.sh

@codecov
Copy link

codecov bot commented Jun 2, 2020

Codecov Report

Merging #603 into alpha will increase coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##            alpha     #603      +/-   ##
==========================================
+ Coverage   94.22%   94.24%   +0.01%     
==========================================
  Files         137      137              
  Lines        2183     2190       +7     
  Branches      622      622              
==========================================
+ Hits         2057     2064       +7     
  Misses        103      103              
  Partials       23       23              
Impacted Files Coverage Δ
src/components/BaseStyles/BaseStyles.tsx 100.00% <100.00%> (ø)
src/components/BaseStyles/BaseStylesService.ts 100.00% <100.00%> (ø)

Copy link
Contributor

@marielakas marielakas left a comment

Choose a reason for hiding this comment

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

🥇

@connor-baer connor-baer merged commit ee8c402 into alpha Jun 3, 2020
@connor-baer connor-baer deleted the feature/load-fonts branch June 3, 2020 15:03
@github-actions
Copy link
Contributor

github-actions bot commented Jun 3, 2020

🎉 This PR is included in version 2.0.0-alpha.21 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

github-actions bot commented Jun 8, 2020

🎉 This PR is included in version 2.0.0-beta.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@github-actions
Copy link
Contributor

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature A new feature or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants