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

Feature request - Google Fonts Async - Make WebFontConfig extendable #217

Closed
nextend opened this issue Nov 28, 2018 · 0 comments
Closed

Comments

@nextend
Copy link
Contributor

nextend commented Nov 28, 2018

I'm the developer of Smart Slider 3 and we use the Web Font Loader library in our code as it is important for our plugin to know when the font families used on the slider are loaded.

There are several things what prevents the proper working if Google Font Async mode enabled in Autoptimize and a slider published on the page with Smart Slider.

  1. Web Font loader does not handle well the multiple WebFont.load calls. Only the first call's configuration parameters used.
  2. Autopmize code always the first to run as it is placed very near to the top. Problems: both events and classes are set to false and later WebFont.load calls can not modify these options.
  3. The Async library load placed right after the creating of the WebFontConfig, so there is no way for others to modify it. (When cache cleared, we can modify the WebFontConfig later as the async library takes some time to load up, but when it is cached there is no way to modify it.)

Possible solution to discuss

Leave the WebFontConfig in the top of the page, but move the async library load into the body, so anyone can modify the WebFontConfig object in the head.

nextend added a commit to nextend/autoptimize that referenced this issue Nov 28, 2018
futtta pushed a commit that referenced this issue Nov 28, 2018
@futtta futtta closed this as completed Nov 28, 2018
futtta pushed a commit that referenced this issue Dec 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants