-
Notifications
You must be signed in to change notification settings - Fork 7
Text flickers before switch to icon with Material Icons font #29
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
Comments
Hi. Thanks for reaching out. The "async" mode causes a FOUT because it renders with fallback font. You need to switch the mode to "render-blocking". |
I thought with the listener though it would trigger when the font is loaded. Currently we have it setup that the icons are |
I see. Will check it out. Does this issue occur on the latest 2.0 version? |
Yeah, hadn't tried previous version. Though I did see that v1 had an "interval" option that could be useful. |
As a quick fix, I can recommend adding a transition CSS property to icons and delay it by 0.1-0.2 seconds with duration of 0 seconds. This should somewhat mitigate the issue until I find a proper fix. |
I tried implementing that (both in our stylesheet and inline style in our custom html file) but it seems as though it never runs. Styles show on the icons, but it's like the |
hey seems like a bug in the code. what I found is font load always fails. I have made PR #30 |
@codeAdrian Just a heads up - Updated to latest version (2.0.1), but still running into the same issue. It appears that the eventHandler adds a 'wf-all' class to the body but about 1-2 seconds later the font actually loads. |
@kramerkm currently fonts.load() returns empty if @font-face is not present or is loaded after fonts.load() code is run. but what i found was library inserts link tag as for now you can add @codeAdrian we need to update |
Hello. Thanks for the heads up. I've pushed the fix you proposed. Let me know if that fixes your issue Current version is 2.0.2. |
We've added this to our Gatsby project as a better way to load Material Icons from Google Fonts. Here is what we have for our config options:
Unfortunately, it seems the listener triggers the
wf-material-icons-sharp-all
class before it's actually loaded and it shows the icon text before flickering to the icon. Any ideas on how to fix this?The text was updated successfully, but these errors were encountered: