Re: [csswg-drafts] Interpolate values between breakpoints (#6245)

The `progress()` parts look good, but I'm not sure about the keyframe-connected aspect of `mix()`. The `mix()` function would need to "know" the property it's being used in for it to grab the correct would-be effect value from the referenced `@keyframes`. That is a bit disturbing.

I'm not yet sure how implementable this is, but I wonder if it's more consistent to instead expose this feature as a native _mixin_-like thing:

```
@keyframes anim {
  from {
    color: rgb(0, 0, 0);
    top: 0px;
  }
  to {
    color: rgb(100, 100, 100);
    top: 100px;
  }
}

div {
  @mix(50% of anim);
  width: 10px;
}
```

Here, `@mix` grabs _all_ the would-be effect values of `anim` at `50%`, and produces styles equivalent to:

```
div {
  /* @mix */
  color: rgb(50, 50, 50);
  top: 50px;

  width: 10px;
}
```

And then we just say [goodbye](https://github.com/w3c/csswg-drafts/issues/9343) to the `mix()` function. :-)


-- 
GitHub Notification of comment by andruud
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6245#issuecomment-1808137676 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Monday, 13 November 2023 13:10:25 UTC