Skip to content

Practical guide to using will-change with currently invisible elements #12411

Open
@Zhang-Junzhi

Description

@Zhang-Junzhi

The spec does not explicitly encourage using will-change on an element that is currently invisible. For example:

.child {
    display: none;
    transition: translate 2s;
}

.parent:focus > .child {
    display: block;
    translate: 100px;
    @starting-style {
        translate: initial;
    }
}

.parent:hover > .child {
    will-change: translate;
}

I recommend the spec add use cases like this. This would imply that the browsers likely have taken will-change into consideration even if the element is currently invisible.

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