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

Closed
Freeplayg opened this issue May 5, 2024 · 1 comment · Fixed by #33933
Closed

CSS Animation examples inefficient ? #33426

Freeplayg opened this issue May 5, 2024 · 1 comment · Fixed by #33933
Assignees
Labels
Content:CSS Cascading Style Sheets docs Content:Glossary Glossary entries

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
@estelle estelle self-assigned this Jun 5, 2024
@estelle estelle removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jun 5, 2024
@estelle
Copy link
Member

estelle commented Jun 5, 2024

You are very correct. Ugh. showing worst practices. Thank you for filing this issue. Fixing now..

estelle added a commit that referenced this issue Jun 5, 2024
estelle added a commit that referenced this issue Jun 10, 2024
* 33426 don't animate box model properties

fixes #33426

* Update files/en-us/web/css/css_animations/using_css_animations/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update files/en-us/web/css/css_animations/using_css_animations/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* vw instead of %

* Update index.md

* Apply suggestions from code review

Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>

* change ::first-line to span

* Update files/en-us/web/css/css_animations/using_css_animations/index.md

* Update files/en-us/web/css/css_animations/using_css_animations/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* fix animation so it reflect text better

* Update files/en-us/web/css/css_animations/using_css_animations/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Update index.md

* link

* Update files/en-us/web/css/css_animations/using_css_animations/index.md

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Co-authored-by: Chris Mills <chrisdavidmills@gmail.com>
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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants