Skip to content

Instantly share code, notes, and snippets.

@natemoo-re
Last active January 15, 2022 21:17
Show Gist options
  • Save natemoo-re/95fba60a7f01907a655bfa32bd4cfe73 to your computer and use it in GitHub Desktop.
Save natemoo-re/95fba60a7f01907a655bfa32bd4cfe73 to your computer and use it in GitHub Desktop.
Token Schema
{
"$id": "https://tokencss.com/schema.json",
"$schema": "http://json-schema.org/draft-04/schema#",
"title": "Token Config",
"type": "object",
"properties": {
"color": {}
},
"$defs": {
"values": {
"color": {
"$id": "#/$defs/values/color",
"description": "The value must be a string containing a hex triplet/quartet including the preceding # character",
"examples": ["#FFF"],
"title": "The color value",
"pattern": "^#[0-9a-fA-F]{3,4,6,8}",
"type": "string"
}
},
"tokens": {
"color": {
"$id": "#/$defs/tokens/color",
"type": "object",
"required": ["value"],
"properties": {
"type": { "enum": "color", "default": "color" },
"value": { "$ref": "#/$defs/values/color" }
}
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment