Syntaxes
February 24, 2025 ยท View on GitHub
CSS value definition syntax is used for the formal syntax of CSS properties. The syntaxes.json file defines many of these CSS syntaxes.
For example, the background-attachment property has the following syntax where <attachment> is referring to a syntax that is defined in syntaxes.json.
Definition of background-attachment in properties.json:
"background-attachment": {
"syntax": "<attachment>#"
}
Definition of <attachment> in syntaxes.json:
"attachment": {
"syntax": "scroll | fixed | local"
},
CSS syntaxes might be more complex than just keywords separated by a pipe (|). For example, the syntax might contain values that are referencing
CSS types:
"alpha-value": {
"syntax": "<number> | <percentage>"
},
Or, syntaxes might reference other syntaxes that are also defined in syntaxes.json:
"length-percentage": {
"syntax": "<length> | <percentage>"
},
For more information about the formal grammar of CSS syntaxes, see CSS value definition syntax.