-
-
Notifications
You must be signed in to change notification settings - Fork 141
Open
Labels
area: frontendRelated to site content and user interactionRelated to site content and user interactionlevel: 1 - intermediatepriority: 3 - lowLow PriorityLow Priority
Description
Problem: The CLS of the website is extremely high. Please view the attached screen shot to verify.
Why this happened: The CLS is calculated by google when layout of the content shifts unintentionally after the render is complete. This happens because:
- The wave animation in the desktop version in the home page are causing shift in the layout because its using viewport as a unit of measurement. The wave-hero element has a height of 32vw. The viewport changes dynamically as the site loads, because of appearance of the scrollbar, font loading, etc. So this causes recalculation of the layout.
- The wave-hero element has a predefined width hardcoded at 6400px. Then, we animate the element via the margin. This causes recalculation of the layout each frame.
- Currently, the SVG is loaded in the stylesheet. If they arrive late, this could cause a repaint which would effect the CLI score.
Why this matters: I know that CLS does not seem that relevant, but google does consider it in their SEO rankings (https://developers.google.com/search/docs/appearance/core-web-vitals)
Fix:
- We should use aspect ratio in the calculation for the height of the hero element.
- We should use transform to animate the wave, as it doesn't trigger layout.
- We can preload the SVG assets in the Django template using
link rel="preload".
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: frontendRelated to site content and user interactionRelated to site content and user interactionlevel: 1 - intermediatepriority: 3 - lowLow PriorityLow Priority