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

,? not ?, #28872

Merged
merged 1 commit into from
Sep 1, 2023
Merged

,? not ?, #28872

merged 1 commit into from
Sep 1, 2023

Conversation

sidewayss
Copy link
Contributor

@sidewayss sidewayss commented Aug 31, 2023

These changes reflect the way the spec does it here, at the very top of this section: https://svgwg.org/svg2-draft/coords.html#ViewBoxAttribute

[<min-x>,? <min-y>,? <width>,? <height>]

I assume that this docs page is intending to imitate the spec on this, but I am not even certain what the ? means. I think it means that these arguments are optional, thus that viewBox requires only one argument. I am submitting this PR largely because I want to find out for certain what the ? means here and in the spec. I don't see any glossary that explains it anywhere. Maybe you can point me to one.

@sidewayss sidewayss requested review from a team and Ryuno-Ki and removed request for a team August 31, 2023 19:54
@github-actions github-actions bot added the Content:SVG SVG docs label Aug 31, 2023
@github-actions
Copy link
Contributor

Preview URLs

Copy link
Collaborator

@wbamberg wbamberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not that familiar with the SVG doc conventions (and I guess at this point noone is) but:

I don't know why we repeat the syntax 5 times, once for every element that can use the attribute. But like I say, not an expert on the SVG docs conventions. Really the SVG docs need a huge amount of work to get them up to scratch :(.

@wbamberg wbamberg merged commit de098c5 into mdn:main Sep 1, 2023
@sidewayss
Copy link
Contributor Author

So you're saying that the ? means it's an optional arg? I don't see a glossary or map of keys for all the symbols in the formal syntaxes you reference, so I'm just making sure. Is there a glossary/keys/legend or whatever for the formal syntax callouts here? I always skim over them because I'm often unsure how to parse them, and some of them are relatively long-winded, like font.

@wbamberg
Copy link
Collaborator

wbamberg commented Sep 2, 2023

So you're saying that the ? means it's an optional arg?

Yes.

I don't see a glossary or map of keys for all the symbols in the formal syntaxes you reference, so I'm just making sure. Is there a glossary/keys/legend or whatever for the formal syntax callouts here?

Formal syntax is documented at https://developer.mozilla.org/en-US/docs/Web/CSS/Value_definition_syntax.

The formal syntax in CSS property &c pages uses tooltips to give a quick summary of the syntax, and the syntax also links to the relevant bit of https://developer.mozilla.org/en-US/docs/Web/CSS/Value_definition_syntax. For example, https://developer.mozilla.org/en-US/docs/Web/css/font#formal_syntax includes ? - if you hover over it, you get the tooltip, if you click it you go to https://developer.mozilla.org/en-US/docs/Web/CSS/Value_definition_syntax#question_mark.

I always skim over them because I'm often unsure how to parse them, and some of them are relatively long-winded, like font.

They are sometimes long and complicated to parse, but IMO it is worth learning the basics, as they give you a very precise explanation of CSS syntax.

@sidewayss
Copy link
Contributor Author

They are sometimes long and complicated to parse, but IMO it is worth learning the basics, as they give you a very precise explanation of CSS syntax.

That's why I asked. Thanks!

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

Successfully merging this pull request may close these issues.

2 participants