Reduce first-load icon flicker with font-display: block and preload guidance#23
Conversation
Agent-Logs-Url: https://github.com/MudBlazor/MudBlazor.Icons/sessions/fc7706eb-3126-40d0-a98c-7a41f446deb0 Co-authored-by: danielchalmers <7112040+danielchalmers@users.noreply.github.com>
…urls Agent-Logs-Url: https://github.com/MudBlazor/MudBlazor.Icons/sessions/fc7706eb-3126-40d0-a98c-7a41f446deb0 Co-authored-by: danielchalmers <7112040+danielchalmers@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MudBlazor/MudBlazor.Icons/sessions/fc7706eb-3126-40d0-a98c-7a41f446deb0 Co-authored-by: danielchalmers <7112040+danielchalmers@users.noreply.github.com>
|
From #22 (comment) |
|
@copilot revert changes except the to avoid flicker as it proven to solve the issue |
Agent-Logs-Url: https://github.com/MudBlazor/MudBlazor.Icons/sessions/4c3c5150-d93a-4655-9c4c-44609d45003f Co-authored-by: ScarletKuro <19953225+ScarletKuro@users.noreply.github.com>
Implemented in commit
... Done in commit |
font-display: block and preload guidance (keep full variable fonts)
|
@copilot do the same for MudBlazor.FontIcons.MaterialIcons |
Agent-Logs-Url: https://github.com/MudBlazor/MudBlazor.Icons/sessions/9eec0945-aad2-4b3c-95af-58949556483e Co-authored-by: ScarletKuro <19953225+ScarletKuro@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MudBlazor/MudBlazor.Icons/sessions/9eec0945-aad2-4b3c-95af-58949556483e Co-authored-by: ScarletKuro <19953225+ScarletKuro@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MudBlazor/MudBlazor.Icons/sessions/9eec0945-aad2-4b3c-95af-58949556483e Co-authored-by: ScarletKuro <19953225+ScarletKuro@users.noreply.github.com>
Implemented for |
font-display: block and preload guidance (keep full variable fonts)font-display: block and preload guidance (Material Symbols + Material Icons)
Updated usage instructions for Material Icons in MudBlazor, including preloading font files to reduce flicker.
font-display: block and preload guidance (Material Symbols + Material Icons)font-display: block and preload guidance

Summary
This PR focuses on reducing first-load icon flicker through loading guidance and CSS behavior for both Material Symbols and Material Icons, while keeping full packaged fonts and existing generator/font packaging behavior.
Changes
GoogleMaterialDesignIconsGeneratorIconHttpClientServicechanges so Material Symbols font acquisition remains as before (full variable-font assets).src/MudBlazor.FontIcons.MaterialSymbols/wwwroot/font/to the original full versions.font-display: blockin Material Symbols@font-facedeclarations.documentation/material_symbols_usage.mdwith explicit preload recommendations for:MaterialSymbolsRounded.woff2MaterialSymbolsOutlined.woff2MaterialSymbolsSharp.woff2font-display: blockto Material Icons@font-facedeclarations infont.cssandfont.min.css.documentation/material_icons_usage.mdwith preload guidance (preload only the variants in use), including optional variant paths.Compatibility
MudBlazor.FontIcons.MaterialSymbols.Rounded.Weight) remain unchanged.Validation
dotnet build src/GoogleMaterialDesignIconsGenerator/GoogleMaterialDesignIconsGenerator.csproj --configuration Releasedotnet build src/MudBlazor.FontIcons.MaterialIcons/MudBlazor.FontIcons.MaterialIcons.csproj --configuration Releasedotnet build src/MudBlazor.FontIcons.MaterialSymbols/MudBlazor.FontIcons.MaterialSymbols.csproj --configuration Release