CSS Object Notation
CSSON is a superset of JSON that is parsed according to CSS syntax.
Any JSON can be parsed as CSSON, though not every CSS Style Sheet can be parsed as CSSON.
Pros:
- CSSON syntax is more expressive and forgiving than JSON syntax, making it friendlier to use
- CSSON includes more types than JSON, allowing your environment to handle the pieces of information in a smarter way
Cons:
- less built-in language support, compared to JSON or XML
<json-number>
<json-string>
<json-true>
<json-false>
<json-null>
<json-array>
<json-object>
CSSON always attemps to parse a JSON type first, so 1
will always be a <json-number>
, not a <css-number>
.
- maximum one value per slot where a value could go
1 /* valid */
1 2 3 /* invalid */
{
number: 1; /* valid */
number: 1 2 3; /* invalid */
}