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

Make FontAwesome script less render-blocking #2115

Open
kaycebasques opened this issue Jan 30, 2025 · 0 comments · May be fixed by #2116
Open

Make FontAwesome script less render-blocking #2115

kaycebasques opened this issue Jan 30, 2025 · 0 comments · May be fixed by #2116

Comments

@kaycebasques
Copy link
Contributor

kaycebasques commented Jan 30, 2025

PageSpeed Insights indicates that the FontAwesome script is a large render-blocking resource on pigweed.dev:

Image

https://pagespeed.web.dev/analysis/https-pigweed-dev-modules-html/9mbvtl2kbd?form_factor=mobile

Currently the FontAwesome script loads in <head>. Proposal here is to load it at the end of <body> instead.

Time to first paint will improve, but some users may see a flash of unstyled content. When the FontAwesome script loads and executes, the unstyled content will get rendered as icons. Presumably this might also cause the browser to recalculate layout.

I'm OK with this tradeoff. If you don't want to impose this change on all PyData Sphinx Theme users, then maybe we can expose it as a configurable option. I.e. loading in <head> remains the default, but there's a config option that lets me load FontAwesome at the end of <body> instead.

(The same thing goes for searchindex.js but I will address that in a different issue.)

kaycebasques pushed a commit to kaycebasques/pydata-sphinx-theme that referenced this issue Jan 30, 2025
@kaycebasques kaycebasques linked a pull request Jan 30, 2025 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant