-
Notifications
You must be signed in to change notification settings - Fork 809
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
Sharing: switch to only a base64-encoded icon font #29441
Conversation
Follow-up to #28849 In #28849, we moved away from using a base64-encoded font and an eot file for multiple reasons: - #6076 - #7148 - #28694 (comment) Instead, we switched to loading 3 files from local paths: - woff2, supported by all modern browsers: https://caniuse.com/woff2 - woff and ttf, around for compatibility with old browsers: https://css-tricks.com/snippets/css/using-font-face-in-css/ Given how widespread woff2 support looks like today, we may be able to use just that. We will, however, need to revert to a base64-encoded font to avoid CORS issues when the files are served from a CDN, like Photon CDN: Access to font at 'https://c0.wp.com/p/jetpack/11.9/_inc/social-logos/social-logos.woff2' from origin 'https://yoursite.com' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. Both approaches seem to be problematic: - base64-encoded fonts are broken for some people. - fonts loaded via a path have CORS issues for everyone using a CDN. => This seems like the biggest problem for us right now, given that Jetpack includes such a CDN. This commit is consequently not a perfect solution. Switching to SVGs, as discussed in #28861, seems to be the path forward.
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 The e2e test report can be found here. Please note that it can take a few minutes after the e2e tests checks are complete for the report to be available. Once your PR is ready for review, check one last time that all required checks (other than "Required review") appearing at the bottom of this PR are passing or skipped. Jetpack plugin:
|
Are you an Automattician? You can now test your Pull Request on WordPress.com. On your sandbox, run
to get started. More details: p9dueE-5Nn-p2 |
@kraftbj Since you were running into those font decoding issues on your site before (see #28694 (comment)), I was wondering if you could give this a try, see how things look like on your end? Thank you! |
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.
Does the job for me
Cherry picked to release branch in 2cb11e2 |
Thank you! |
Proposed changes:
Follow-up to #28849
In #28849, we moved away from using a base64-encoded font and an eot file for multiple reasons:
Instead, we switched to loading 3 files from local paths:
woff2
, supported by all modern browsers: https://caniuse.com/woff2woff
andttf
, around for compatibility with old browsers: https://css-tricks.com/snippets/css/using-font-face-in-css/Given how widespread
woff2
support looks like today, we may be able to use just that. We will, however, need to revert to a base64-encoded font to avoid CORS issues when the files are served from a CDN, like Photon CDN:Both approaches seem to be problematic:
This commit is consequently not a perfect solution. Switching to SVGs, as discussed in #28861, seems to be the path forward.
Other information:
Jetpack product discussion
Does this pull request change what data or activity we track or use?
Testing instructions:
Test with different browsers
social-logos.min.css
file under c0.wp.com > p > jetpack > 11.9 > _inc > social-logos