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

refactor(v2): remove transition on body element #4795

Merged
merged 1 commit into from
May 18, 2021

Conversation

lex111
Copy link
Contributor

@lex111 lex111 commented May 14, 2021

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:

ezgif com-gif-maker

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.)

@lex111 lex111 added the pr: polish This PR adds a very minor behavior improvement that users will enjoy. label May 14, 2021
@lex111 lex111 requested a review from slorber as a code owner May 14, 2021 14:55
@facebook-github-bot facebook-github-bot added the CLA Signed Signed Facebook CLA label May 14, 2021
@@ -10,11 +10,6 @@ body {
height: 100%;
}

body {
margin: 0;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@netlify
Copy link

netlify bot commented May 14, 2021

[V1]

Built with commit 28ef370

https://deploy-preview-4795--docusaurus-1.netlify.app

@netlify
Copy link

netlify bot commented May 14, 2021

[V2]

Built with commit 28ef370

https://deploy-preview-4795--docusaurus-2.netlify.app

@github-actions
Copy link

⚡️ Lighthouse report for the changes in this PR:

Category Score
🟠 Performance 61
🟢 Accessibility 96
🟢 Best practices 100
🟢 SEO 100
🟢 PWA 95

Lighthouse ran on https://deploy-preview-4795--docusaurus-2.netlify.app/

@github-actions
Copy link

Size Change: -49 B (0%)

Total Size: 640 kB

Filename Size Change
website/build/assets/css/styles.********.css 88.4 kB -49 B (0%)
ℹ️ View Unchanged
Filename Size Change
website/build/assets/js/main.********.js 463 kB 0 B
website/build/blog/2017/12/14/introducing-docusaurus/index.html 62 kB 0 B
website/build/docs/introduction/index.html 235 B 0 B
website/build/index.html 26.9 kB 0 B

compressed-size-action

@slorber
Copy link
Collaborator

slorber commented May 18, 2021

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/

@lex111
Copy link
Contributor Author

lex111 commented May 18, 2021

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/

@slorber
Copy link
Collaborator

slorber commented May 18, 2021

Not 100% sure to understand how a blog is different from a doc, both can have the same lag imho.
I think it's safe to merge because it can be easily re-enabled with custom css if users want to keep this behavior

@slorber slorber merged commit be9f9d6 into master May 18, 2021
@slorber slorber deleted the lex111/transition-body branch August 17, 2021 18:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: polish This PR adds a very minor behavior improvement that users will enjoy.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants