-
Notifications
You must be signed in to change notification settings - Fork 2k
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
General: Bundle a local version of Merriweather instead of loading from Google Fonts. #2766
Conversation
Everything seems to be working as expected here, but would love to get more eyes on it, particularly on non-Mac, non-iOS devices if possible. |
I think we will want to serve this from a CDN on WordPress.com. I wonder if it's better to add it to our CDN and then include that in Calypso instead? |
I figured that would be the case for WordPress.com. I thought bundling it locally would be nice for local development (one fewer external dependency), but don't have a strong opinion on which way we include it. |
Gave it a spin on Mac (safari, chrome, firefox), Windows 10 (Edge, Firefox, Chrome) and Android (chrome) and all works as expected. Also, my eyes thank you. |
@mattmiklic I think it's good to bundle it locally too. What if we first try the WordPress.com CDN, and then fall back to the local version that you have here? |
This makes sense to me.
Thank you @shaunandrews! |
@mtias Do you have some thoughts here? We need to load the old version of Merriweather, so we're bundling it locally to load. I'd imagine that for WordPress.com we will want to use the CDN. What's the best way to load it from the CDN for WordPress.com only? Or should we just load it from the CDN for everyone, and fall back to a local copy with a bad connection? |
I was playing around with these ideas in #2719 @mattmiklic, maybe we can combine our efforts? I want all resources to be loaded locally if cdn is not accessible. We can detect CSS missing by (this is
Apparently support for |
Makes sense to me. We'll want to use the font files I've added here, since they'll give us browser support that should be equal to what we got with Google Fonts. I'll defer on the code that actually calls them, since I think you guys know the best way to handle that. |
@artpi @apeatling Is there anything else you guys need from me to make this change? |
sorry @artpi, I will look at this tomorrow. |
@mtias Would really like to get this one squared away so we don't have the new version of Merriweather sticking around. Could you take a look here? |
@@ -124,7 +124,7 @@ const CONTENT_CSS = [ | |||
window.app.tinymceWpSkin, | |||
'//s1.wp.com/wp-includes/css/dashicons.css', | |||
window.app.tinymceEditorCss, | |||
'//fonts.googleapis.com/css?family=Merriweather:700%2C400%2C700italic%2C400italic', | |||
'/calypso/fonts/merriweather/merriweather.css', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mattmiklic can we have this in WP.com cdn as well?
@apeatling @mattmiklic @artpi let's get this loaded from WP.com CDN to start as the fastest immediate fix for the visual design we want. We should continue looking at loading local assets for development separately like Artur proposes but no need to conflate the two issues right now. |
This sounds good to me -- I'm not sure how to go about doing this, though. |
053faee
to
481fcb1
Compare
Update reference to Merriweather in Tinymce. Switch 404, 500, desktop templates to use local Merriweather. Add Merriweather license. Trim whitespace. Arrange by weight.
481fcb1
to
300a7f2
Compare
@apeatling @mattmiklic mind giving this branch a go? |
@mtias Tested the following:
Everything looked good. |
Excellent! |
👍 Looks good |
General: Bundle a local version of Merriweather instead of loading from Google Fonts.
On January 22, the version of Merriweather hosted on Google Fonts was updated to version 1.582. This version includes significant visual departures from the original version of Merriweather. This PR bundles the original version of Merriweather into Calypso, and replaces the existing references to Google Fonts' version of Merriweather.
I've tested in the following browsers: IE 11, Edge, Chrome 48 (Mac/Win), Firefox 43 (Mac/Win), Safari 9, Safari for iOS 9, Chrome 47 Android, Firefox 43 Android.
The "before" in the following screenshots show what Calypso looks like today. The "after" is the result of this PR, and is identical to what Calypso looked like prior to January 22.
Chrome 48 Win:
![chrome-48-win](https://cloud.githubusercontent.com/assets/1396552/12568233/6dde9ec8-c392-11e5-83d0-bb189d7e18bf.png)
Firefox 43 Win:
![firefox-43-win](https://cloud.githubusercontent.com/assets/1396552/12568238/73359778-c392-11e5-8123-25edc3f5dd86.png)
Edge:
![edge-win](https://cloud.githubusercontent.com/assets/1396552/12568242/78fe7dd2-c392-11e5-9278-90997baef438.png)
IE 11 (could not log into calypso.localhost in IE11, screenshot is from
![ie-11-win](https://cloud.githubusercontent.com/assets/1396552/12568245/7d092026-c392-11e5-9638-07d394cab292.png)
/devdocs/
):Chrome 48 OS X:
![chrome-48-osx](https://cloud.githubusercontent.com/assets/1396552/12568250/84acdb1a-c392-11e5-85d8-a449b0917fc7.png)
Firefox 43 OS X:
![firefox-43-osx](https://cloud.githubusercontent.com/assets/1396552/12568253/88883888-c392-11e5-90ce-30253cf9a5b4.png)
Safari 9 OS X:
![safari-9-osx](https://cloud.githubusercontent.com/assets/1396552/12568258/8d9efbea-c392-11e5-8c60-95332c0dadc7.png)
Safari 9 iOS:
![safari-9-ios](https://cloud.githubusercontent.com/assets/1396552/12568262/921075a0-c392-11e5-8cb7-8346ffc4bd70.png)
Chrome 47 Android:
![chrome-47-android](https://cloud.githubusercontent.com/assets/1396552/12568267/97097e76-c392-11e5-95f3-ef9eb4d543a0.png)
Firefox 43 Android:
![firefox-43-android](https://cloud.githubusercontent.com/assets/1396552/12568276/9c3c1fb6-c392-11e5-8140-058b0776bd3a.png)
TODO:
cc @apeatling