Re: [csswg-drafts] [css-contain-3] Provide a syntax to query a specific container-type (#6393)

For the shorthand-like proposal, I assume it should be possible to _only_ specify a name or only specify a type? In that case we would need to exclude `size`, `inline-size` etc from the `<custom-ident>`of `<container-name>`, and then we're back at the problem of magic keywords.

> better approach than adding a type() 

Validate its existence somewhat by also having `name()` for name-based selection? :slightly_smiling_face: 

> clearer delineation

Maybe it helps to demand parens, i.e. make the grammar `<media-in-parens>` (or container-in-parens) rather than `<container-query-list>`:

```
<container-selection> = <container-name> | [ name(<container-name>+)? type(<container-type>+)? ]

@container <container-selection>? <media-in-parens> {
  <stylesheet>
}
```

Although one thing to watch out for here is that if `fn()` is valid for both the selection and the query, we get a problem with: `@container fn() {}`. So maybe `<media-in-parens>` is not enough.

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


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

Received on Friday, 18 June 2021 08:52:21 UTC