Search code examples
syntaxdocumentation

What is this syntax description language describing? Does it have a name or a standard?


I was reading about flexboxes on CSS tricks and came across this

flex: none | [ <'flex-grow'> <'flex-shrink'>? || <'flex-basis'> ]

Is there a name for this particular style of syntax? Is there a standard? How is one supposed to interpret it?


Solution

  • It's a slightly modified BNF, Backus-Naur Form. This diagram specifically says the flex property is either blank (none) or has a flex-grow property, an optional flex-shrink (that's the ? at the end), and/or there is a flex-basis.