Skip to content

Animating box-shadow forces paint #37

@IchordeDionysos

Description

@IchordeDionysos

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 )

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions