Skip to content

[Custom Highlight API Extensions] Animations per-element #1433

Open

Description

Robert Flack (@flackr) wrote:

I don't understand why you need animations on individual elements and having animations be per element sounds like it would create a multiplicative effect of the cost of highlights. The highlight affects the rendered style but it does not need to interact with the individual element styles, just the painting which it already does.

Activity

  1. kbabbitt commented on Nov 3, 2026

    @kbabbitt
    MemberAuthor

    Thanks. That behavior is a consequence of the fact that highlights resolve styles per-element today. For example, if I have:

    <p style="color:red">A paragraph <span style="color:blue">with a nested span</span> and then more text</p>

    And apply this highlight over the entire paragraph:

    ::highlight(shadow) {
      text-shadow: 4px 4px 6px currentcolor;
    }

    The red text gets a red shadow and the blue text gets a blue shadow.

    Now if I apply:

    ::highlight(greenify) {
      color: green;
      transition: color 1s;
    }

    I need two different interpolations, one from red to green and one from blue to green.

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

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