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

Animating box-shadow forces paint #37

Open
IchordeDionysos opened this issue May 28, 2016 · 1 comment
Open

Animating box-shadow forces paint #37

IchordeDionysos opened this issue May 28, 2016 · 1 comment

Comments

@IchordeDionysos
Copy link

The paper-material element animates the box-shadow attribute, which causes paint. There is a better way to do this:

Explained in more detail

Expected outcome

Create a pseudo-element with the new box-shadow, set it's opacity initially to 0 and animate the opacity to 1, so only have 1 paint at the end of the transition if you want to set the box-shadow of the proper element.

Actual outcome

Actual the animation is hardly running at 60FPS

Live Demo

Demo with actual and expected method

Browsers Affected

According to csstriggers.com this is the case in all common browsers in EdgeHTML the actual method doesn't cause Layout but as well a repaint

I hope you fix this because I think there would be some refactoring needed if you do and I really hope you want to do it. (FOR THE PERFORMANCE :D )

@notwaldorf
Copy link
Contributor

To be honest, if you're concerned about performance, you shouldn't be using this element in the first place -- we plan on deprecating it in favour of just using its css styles directly, which is what other elements (like paper-button) are already doing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants