-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
refactor(v2): remove transition on body element #4795
Conversation
@@ -10,11 +10,6 @@ body { | |||
height: 100%; | |||
} | |||
|
|||
body { | |||
margin: 0; |
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.
No needed, since Infima already resets value for body margin https://github.com/facebookincubator/infima/blob/488499b987ad71e00285f5b0433f871b6b3d09dc/packages/core/dist/css/default/default.css#L366
[V1] Built with commit 28ef370 |
[V2] Built with commit 28ef370 |
⚡️ Lighthouse report for the changes in this PR:
Lighthouse ran on https://deploy-preview-4795--docusaurus-2.netlify.app/ |
Size Change: -49 B (0%) Total Size: 640 kB
ℹ️ View Unchanged
|
Wonder what is the best practice here? Should we apply transitions on a per-element basis instead? I see that some other people are using transition on body, for example https://www.joshwcomeau.com/ |
In our case, this (when we are dealing with docs) is not suitable, because it will cause lags when switching color mode. So I would focus on similar sites as an example, eg https://material-ui.com/ |
Not 100% sure to understand how a blog is different from a doc, both can have the same lag imho. |
Motivation
Overall, this is bad approach. And in our case, it can cause lags when switching color mode (especially if there is lot of content on a page), see for example:
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Preview.
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)