Re: [csswg-drafts] [selectors-4] Add pseudo-class to establish before-change style for css-transitions on new elements. (#8174)

My issue with this proposal is that this is designed around browser engine internals rather than concepts web developers understand. Not sure the definition of "initial" will be easy to grasp for web developers.

My gut feeling is that the spec should be rewritten in a way where the following "just works", since that is what I think most web developers will expect.

```
div {
  display: none;
  opacity: 0;
  transition: opacity 2s;
}

div.visible {
  opacity: 1;
  display: block;
}
```

I don't think:
```
dialog {
  transition: opacity 200ms;
  opacity: 1; /* Not necessary as it is the default but added for illustration. */
}
dialog:initial {
  opacity: 0;
}
```
is more explicit than:

```
@keyframes fade-in {
  from { opacity: 0; }
}
dialog {
  animation: fade-in 200ms;
  opacity: 1; /* Not necessary as it is the default but added for illustration. */
}
```

nor it is much shorter to write.




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


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

Received on Tuesday, 17 January 2023 06:53:28 UTC