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
chore: reduce cumulative layout shifts #15926
Conversation
✅ Deploy Preview for docs-eslint ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
d613920
to
ce16362
Compare
What's the result for mobile? I'm getting CLS 0.9 on new.eslint.org/docs |
Please pull the latest commit. I tried using the |
Exactly the same results I am getting in the After changes (in
|
Now I noticed we have Can you try with that instead of
I think we should remove |
<noscript> | ||
<a href="/versions/" class="switcher-fallback">Versions</a> | ||
</noscript> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we use the enhanced
class name (the one that replaces no-js
on html) to hide all fallback links, and then we won't need to use <noscript>
?
Something like .enhanced .switcher-fallback { display: none !important }
in the <style>
we added to <head>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, we can use the enhanced
class instead of <noscript>
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
This looks noticeably better than before, especially on mobile. And the lighthouse report shows the improvement:
CLS before: 0.9
CLS after: < 0.1
I would like more reviews from other team members before merging.
I converted this to draft since we first need to sync these files with the latest version of the prototype (#15944), as we noticed that the initial version in this repo was not the latest one from the prototype. |
Closing this in favour of #16047 |
Prerequisites checklist
What is the purpose of this pull request? (put an "X" next to an item)
[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain:
Reduced CLS in new docs site.
What changes did you make? (Give an overview)
Reduced CLS.