-
Notifications
You must be signed in to change notification settings - Fork 808
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
Optimize Social-Logos CSS #13363
Optimize Social-Logos CSS #13363
Conversation
Removing the data attribute saves a lot of resources, removes the duplicate EOT font-face to further save on resources and adds the woff2 format in as well.
This is an automated check which relies on |
@jasmussen Do you think you could take a look at this? You've always been my go-to expert for font optimisations :) Thank you! |
Thank you so much for the PR, very much appreciate your work. So the reason the WOFF font is base64 encoded inline, is actually to solve a challenge with, if I recall correctly, Firefox. Specifically, Firefox blocks cross origin domain requests, unless your server is configured juuust right. In most cases, this won't be a problem, because the font CSS will live in the same directory as the font file. However as soon as you offload the CSS or the font files to an external CDN — e.g. your website is As mentioned, this can be configured to work on the server. But in many cases people might install Jetpack alongside a CDN plugin and not really know how to configure their server to work with what the CDN plugin does, and the experience will simply appear broken to them. To be clear, the above is historical context. Things may have changed, but in case they haven't it's important to test whether this is still the case, before merging. |
If I recall Internet Explorer does the same behavior and yet we load the .eot file as URL as opposed to being inlined. Also, isn't this fixing a problem that somebody else is creating as Jetpack is following the standard here where the CDN provider may not? However, WordPress Core on a broader note is guilty of this as well when it comes to Dashicons. It's an interesting issue though because this is a resolution to a problem someone or something else is creating yet the proper course of action isn't my call! The above implementation is certainly the most efficient and echos the standard as closely as possible! |
This is mentioned here: There are also some more explorations here:
Indeed. I suppose it was implemented that way for the same reasons @jasmussen mentioned above: This was brought up here, but closed as maybelater: Also related:
This doesn't seem to be an issue in Internet Explorer, as far as I can tell:
It's definitely fixing a problem that may be fixed on the server directly. That doesn't mean we shouldn't try to play nice and help, though :)
I'll try to test that scenario to see if it is still valid, or if we could go with Scott's changes now. |
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.
The concerns raised here seem to be valid still. I was able to reproduce the issue in different browsers (Chrome and Firefox) when checking out this patch and serving the social logo files (that include the patch) from a CDN on another domain.
When reverting the patch, the errors disappear.
I'm afraid that means we won't be able to fix the problem you raised in #13201 for now, as long as we want to support sites with such a setup.
Closing this PR as this can't be merged as is right now. |
This pull request resolves the issue I reported in #13201
This pull request does a few things.
Fixes #13201
(I also had a typo in one of the commits where I included woff2 twice so the additional commits were to resolve this).
Testing Instructions
Proposed changelog entry for your changes: