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

CSS Animation examples inefficient ? #33426

Open
Freeplayg opened this issue May 5, 2024 · 0 comments
Open

CSS Animation examples inefficient ? #33426

Freeplayg opened this issue May 5, 2024 · 0 comments
Labels
Content:CSS Cascading Style Sheets docs Content:Glossary Glossary entries needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@Freeplayg
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animations/Using_CSS_animations

What specific section or headline is this issue about?

Examples

What information was incorrect, unhelpful, or incomplete?

The example suggests to you use margins and width for animating text across the screen.
Isn't this bad for performance due to constantly needing to recalculate the layout? I feel like this should at least be mentioned somewhere in the article if the examples aren't changed.

What did you expect to see?

Animating the transform property would be the better option, as it doesn't change the layout while animating, and is actually simpler than the proposed example?

@keyframes {
    from {
        transform: translateX(100%)
    }
}

Although https://developer.mozilla.org/en-US/docs/Web/CSS/transform may need to be linked, as well

Do you have any supporting links, references, or citations?

https://developer.mozilla.org/en-US/docs/Glossary/Reflow
https://web.dev/articles/animations-guide#triggers

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@Freeplayg Freeplayg added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label May 5, 2024
@github-actions github-actions bot added Content:CSS Cascading Style Sheets docs Content:Glossary Glossary entries labels May 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs Content:Glossary Glossary entries needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

No branches or pull requests

1 participant