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

Fix flickering issues by changing order of meta tags #853

Merged
merged 2 commits into from
Feb 23, 2020

Conversation

rdb
Copy link
Contributor

@rdb rdb commented Nov 5, 2019

I noticed that our own documentation, and many other instances of Sphinx documentation using this theme, all exhibited a FOUC when switching pages as the CSS was still being loaded. I opened the HTML files and noticed that the JS files were being loaded first. I'm not sure why; isn't it more important to load the CSS first?

This PR does that by moving the CSS a bit further up so that it can be loaded before the JavaScript needs to run. It fixes the flickering issues I have observed in Firefox.

Also see #847.

This fixes flickering issues when switching pages.
@agjohnson
Copy link
Collaborator

I'm going to mark this as needing replication. I'm +1 on the fix if someone can verify bumping the CSS up in the head does in fact help with the fouc. I'm focusing on html5 writer compatibility currently, but will have some time to review when we have an RC ready.

@OskarPersson
Copy link

OskarPersson commented Dec 19, 2019

@rdb Doesn't #848 solve your problem?

@rdb
Copy link
Contributor Author

rdb commented Dec 19, 2019

Not quite, because that's not the only bit of JS that is being loaded (I'm adding additional JS files as well in my conf.py). It general, it seems clear to me that the CSS should be loaded before the JS.

eine added a commit to buildthedocs/sphinx.theme that referenced this pull request Jan 3, 2020
eine added a commit to buildthedocs/sphinx.theme that referenced this pull request Jan 4, 2020
@Blendify
Copy link
Member

I can confirm the flickering issue

@jacobtomlinson
Copy link

Any chance of this getting merged?

eine added a commit to buildthedocs/sphinx.theme that referenced this pull request Feb 3, 2020
jacobtomlinson added a commit to jacobtomlinson/dask-sphinx-theme that referenced this pull request Feb 7, 2020
Moving the CSS above the JS avoids the page load flicker. However
the upstream layout doesn't allow overriding this so I've had to
pull in the whole layout in order to make the modifications.

Ideally this should be fixed upstream but the PR to resolve it
has been stuck for some time.

readthedocs/sphinx_rtd_theme#853

If this PR is ever merged we should revert back to using the
inheritance.
@rryan
Copy link

rryan commented Feb 20, 2020

Can also confirm the FOUC issue on Firefox on this project that was built today: https://mixxx.org/manual/latest/

@jacobtomlinson
Copy link

@agjohnson as multiple people have now confirmed the issue could this please be reviewed again?

@Blendify Blendify merged commit d8bd069 into readthedocs:master Feb 23, 2020
@MatinF
Copy link

MatinF commented Apr 15, 2020

I can confirm this issue as well

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needed: replication Bug replication is required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants