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

Or maybe what was meant is basically defining a named reusable state, similar to how keyframes define them?

Reusing the example from the opening message:

```CSS
@initial-state hidden {
    opacity: 0;
}

dialog {
  transition: opacity 200ms;
  opacity: 1; /* Not necessary as it is the default but added for illustration. */

  initial-state: hidden; /* Uses the pre-defined state */
}
```

So, could be also a at-rule + prop pair, and this would easily unlock any configuration we could want to do on the usage side, adding additional sub-properties to the `initial-state` that can become a shorthand or something.

I guess, this could come too close to mixins though :)

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


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

Received on Thursday, 2 March 2023 09:15:53 UTC