Skip to content

Commit

Permalink
fix: the format of the call to css2 has changed (#258)
Browse files Browse the repository at this point in the history
* fix: the format of the call to css2 has changed
* fix: use correct tuple for italic
  • Loading branch information
neil-buckley authored Jun 17, 2021
1 parent b33c431 commit 3f88049
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions morph/react-dom/morph-font.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ export default (font, sources) => {

if (isGoogleFont(font.family)) {
let family = font.family.replace(/\s/g, '+')
let style = font.style === 'italic' ? 'i' : ''
body = `@import url('https://fonts.googleapis.com/css2?family=${family}:wght@${font.weight}${style}&display=swap');`
let style = font.style === 'italic' ? 'ital,' : ''
body = `@import url('https://fonts.googleapis.com/css2?family=${family}:${style}wght@${
style !== '' ? '1,' : ''
}${font.weight}&display=swap');`
} else {
body = `@font-face {
font-display: swap;
Expand Down

0 comments on commit 3f88049

Please sign in to comment.