Re: [csswg-drafts] [css-display] Why is display listed as not animatable instead of animation type: discrete? (#6429)

Reopening this to consider allowing animations of display to prevent the element from immediately computing to `display: none`.

In particular, my straw-man proposal is the following:
1. Animation keyframes may specify display values which are not none. `display: none` is dropped from keyframes.
2. Display is interpolated like visibility, i.e. it will prefer the non-none value.

With these two points, we shouldn't have any circularity. An animation cannot itself produce `display: none` since it can't specify it (rule 1). Transitions to `display: none` would also work since the `display: none` wouldn't apply until after the transition finished (rule 2).

With this, developers could do things like:
```css
.hide {
  transition: opacity 200ms, display 200ms;
  display: none;
  opacity: 0;
}
```

Or:
```css
@keyframes slideaway {
  to { transform: translateY(40px); opacity: 0; display: block; }
}

.hide {
  animation: slideaway 200ms;
  display: none;
}
```

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


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

Received on Thursday, 17 November 2022 18:23:05 UTC