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

html loads before css #560

Open
michellestegem opened this issue Apr 19, 2024 · 2 comments
Open

html loads before css #560

michellestegem opened this issue Apr 19, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@michellestegem
Copy link
Collaborator

Describe the bug
The cara lab website (https://www.cara-ai-lab.nl/) shows the HTML before CSS when accessing the website for the first time

https://stackoverflow.com/questions/4172281/force-browsers-to-load-css-before-showing-the-page

Screenshots (if applicable)
image

Device information
Windows - firefox

@michellestegem michellestegem added the bug Something isn't working label Apr 19, 2024
@martvanrijthoven
Copy link
Contributor

This is because cara website does not have critical css, because it is the only website that does share the css for all the other websites.

The critical css for other websites is defined here:
https://github.com/DIAGNijmegen/website-content/tree/master/radboudumc-template/templates/critical_css

This is extracted (locally) with this script:
https://github.com/DIAGNijmegen/website-content/blob/master/above-the-fold/extract-css.js

If you want to have critical css for cara website, you will need to extract it by loading cara website locally and extract the css and upload it somewhere in the repo and modify the path to critical css for cara website

Here is the commit that made sure cara website could work without critical css
804936d

@martvanrijthoven
Copy link
Contributor

You probably dont want to force load the all the css for cara website as that will make loading the website slower and that gives the website a lower score and then it will be lower ranked in search engines

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants