Re: [csswg-drafts] [css-view-transitions-2] Feature detection for VT cross-document (#9891)

> And the CSS detection can use `@supports` for the view-transition at-rule.

I'm happily proven wrong but I don't think that's currently possible, because the resolution of https://github.com/w3c/csswg-drafts/issues/2463#issuecomment-1016720310 still didn't make it into the spec. and much less into browsers.

With that, support checking general support for `@view-transition` can be done like this in CSS:

```css
@supports at-rule(@view-transition) {
  …
}
```

Analogous, in JS this would look like this:

```js
if (CSS.supports('at-rule(@view-transition)') {
  …
}
```

or by checking for the `CSSViewTransitionRule` interface:

```js
if (CSSViewTransitionRule) {
}
```

Sebastian

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


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

Received on Wednesday, 10 July 2024 09:58:40 UTC