[csswg-drafts] [css-grid] Mark up minmax() and fit-content() as functions in the spec? (#7682)

wbamberg has just created a new issue for https://github.com/w3c/csswg-drafts:

== [css-grid] Mark up minmax() and fit-content() as functions in the spec? ==
I've been working on displaying the syntax of CSS features on MDN, via the [webref](https://www.npmjs.com/package/@webref/css) package. We do this using a macro that uses fetches the syntax from webref, then tries to render it nicely, like: https://developer.mozilla.org/en-US/docs/Web/CSS/border#formal_syntax.

There are a few places where this isn't working: two that I have found are [`minmax()`](https://drafts.csswg.org/css-grid/#valdef-grid-template-columns-minmax) and [`fit-content()`](https://drafts.csswg.org/css-grid/#valdef-grid-template-columns-fit-content). These look like functions, and the MDN pages are tagged as functions, but in the specs they are not marked up as functions, so they don't appear in webref, and we're not able to show any syntax for them on MDN.

There's more on this here: https://github.com/mdn/content/issues/18780#issuecomment-1216912692 :

> > Finally <minmax()> doesn't seem to have an entry at all although [it is listed as a component of some other types](https://github.com/w3c/webref/blob/a5ca70b00c96c92a519f118141c977711ff8f687/ed/css/css-grid.json#L252-L254). Again, the same applies to some other functions, like <fit-content()>, where we don't see an error because our [fit-content() page](https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content) does not attempt to include formal syntax.
> 
> Both `minmax()` and `fit-content()` look like CSS functions but they are not defined as CSS functions (the spec defines them with a `data-dfn-type="value"` and not a `data-dfn-type="function"`). They are rather defined as "simple" values as `auto` or `inherit`. If they were real CSS functions, the definition of `<track-size>` would not be:
> 
> ```
> <track-breadth> | minmax( <inflexible-breadth> , <track-breadth> ) | fit-content( <length-percentage> )
> ```
> 
> ... but rather
> 
> ```
> <track-breadth> | <minmax()> | <fit-content()>
> ```
> 
> Why is that? I don't know :) You may want to ask the CSS working group why they sometimes decide to create functions and sometimes decide to leave them as pure textual syntax. It may not be intentional.

So I wondered whether there's a reason that these features are not marked up as functions in the specs.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/7682 using your GitHub account


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

Received on Friday, 2 September 2022 22:48:36 UTC