Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fit-content() Formal syntax section shows an error #37441

Open
Hexstream opened this issue Dec 29, 2024 · 7 comments
Open

fit-content() Formal syntax section shows an error #37441

Hexstream opened this issue Dec 29, 2024 · 7 comments
Labels
Content:CSS Cascading Style Sheets docs

Comments

@Hexstream
Copy link

MDN URL

https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content_function

What specific section or headline is this issue about?

Formal syntax

What information was incorrect, unhelpful, or incomplete?

Error: could not find syntax for this item

What did you expect to see?

The formal syntax for fit-content().

Do you have any supporting links, references, or citations?

Apparently, this should be treated the same as minmax(), which does have a working Formal syntax section.

Do you have anything more you want to share?

No response

MDN metadata

Page report details
@Hexstream Hexstream added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Dec 29, 2024
@github-actions github-actions bot added the Content:CSS Cascading Style Sheets docs label Dec 29, 2024
@wbamberg
Copy link
Collaborator

Thank for filing!

Apparently, this should be treated the same as minmax(), which does have a working Formal syntax section.

"treated the same as minmax()", when this comment was written, meant not including formal syntax, because neither of those functions were marked up as functions in the specs, so didn't appear in the @webref/css package, which is used as the source for this content.

But recent PRs like #37210 then added formal syntax for all functions, including fit-content(). What I don't understand though is why this works in the preview page (https://pr37210.content.dev.mdn.mozit.cloud/en-US/docs/Web/CSS/fit-content_function#formal_syntax) but not in production. Perhaps they are using different versions of @webref/css?

@skyclouds2001
Copy link
Contributor

yes, it seems very strange...

@OnkarRuikar
Copy link
Contributor

We have two pages for fit-content:

  1. https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content - spec Box sizing module
  2. https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content_function - wrongly shows box sizing module as specs but should be shown as part of the grid layout module (ping @estelle). And webref does have syntax for it.

In the local dev environment, yarn start (Yari) shows the syntax, and yarn start:rari doesn't. (ping @fiji-flo )

[server] buildDocumentFromURL(/en-US/docs/Web/CSS/fit-content_function): 483.446ms
[server] using http://localhost:8083/en-US/docs/Web/CSS/fit-content_function
[rari]  WARN serve{req=11}:url{/en-US/docs/Web/CSS/fit-content_function}:page{en-US:Web/CSS/fit-content_function}
  :templ{templ="csssyntax" line=49 col=1}
  : rari_doc::templ::render: Error: could not find syntax for this item

Prod has moved to Rari, but GitHub workflows are still using Yari. Based on the discussions about other PRs, GitHub workflows will be updated in the near future.

@wbamberg
Copy link
Collaborator

wbamberg commented Jan 1, 2025

We have two pages for fit-content:

  1. https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content - spec Box sizing module

  2. https://developer.mozilla.org/en-US/docs/Web/CSS/fit-content_function - wrongly shows box sizing module as specs but should be shown as part of the grid layout module (ping @estelle). And webref does have syntax for it.

Yes, I know there are two pages for fit-content. This issue is about the page for the fit-content() function. We don't include formal syntax in keyword pages.

Prod has moved to Rari, but GitHub workflows are still using Yari. Based on the discussions about other PRs, GitHub workflows will be updated in the near future.

Ah, OK, so this seems like a rari issue.

@fiji-flo
Copy link
Contributor

fiji-flo commented Jan 1, 2025

Sorry for this. There was no occurrence of {{csssyntax}} using an argument. I'll release support for this nowish.

I see this being used 3 times:

  • font-stretch: an alias to font-width this has been around for a while but worked since cssref contained font-stretch if I see this correct.
  • fit-content: stripping the _function from the slug.
  • url: stripping the _function from the slug.

It's easy to strip and option _function for page-type css-function in the macro if we want this. Then there's only the aliasing case left. Any idea?

(I might respond slowly as I'm only back working next week)

@skyclouds2001
Copy link
Contributor

for references:

#37212
#37211
#37210

@Josh-Cena Josh-Cena removed the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jan 2, 2025
@OnkarRuikar
Copy link
Contributor

This issue is about the page for the fit-content() function. We don't include formal syntax in keyword pages.

😕 You called it a function yourself! Unlike fit-content, the fit-content() is a value function. How is grid-template-rows: fit-content(40%) different from width: calc(2em * 5) in terms of being a value function? Or width: fit-content(10%); different from width: var(--default-width)?


Then there's only the aliasing case left. Any idea?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:CSS Cascading Style Sheets docs
Projects
None yet
Development

No branches or pull requests

6 participants