Re: [csswg-drafts] [css-values-4] Allow an inline way to do "first value that's supported" (#5055)

From the comments above, `display: first-valid(foo, bar)` is invalid at parse time. But the current text says:

  > If none of the arguments represent a valid value for the property, the property is invalid at computed-value time.

---

If it is resolved and validated at parse time (in standard properties), how should serialize `display: first-valid(grid)`? Should it serialize naked?

---

Is it ok that `--custom: first-valid(1) first-valid(1)` remains valid?

---

  > > Would it be available in descriptors as well?
  >
  > I don’t see why not.

CSS Values defines the set of valid values for properties *and in many other places* but it seems sane to consider something invalid when it is not explicitly valid. Besides, most substitution functions in CSS Values 5 cannot be valid in descriptor values. 

For example, `first-valid(ns1|type, ns2|type) { ... }` should presumably be an invalid style rule. However, it might be useful as a [`<mf-value>`](https://drafts.csswg.org/mediaqueries-5/#typedef-mf-value). If you also think so, it would be great to explicitly include it in its alternatives, or allow it in prose.

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


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

Received on Thursday, 2 May 2024 12:11:11 UTC