Skip to content

Text flickers before switch to icon with Material Icons font #29

Closed
@kramerkm

Description

@kramerkm

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:

resolve: 'gatsby-omni-font-loader',
options: {
    mode: 'async',
    enableListener: true,
    preconnect: ['https://fonts.gstatic.com'],
    preload: ['https://fonts.googleapis.com/css?family=Material+Icons+Sharp'],
    web: [{
	name: 'Material Icons Sharp',
	file: 'https://fonts.googleapis.com/css?family=Material+Icons+Sharp'
    }]
}

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions