From ecdbb9fe2c66288d95bb7f197e2247fa70efee10 Mon Sep 17 00:00:00 2001 From: James Brumond Date: Mon, 17 Oct 2022 23:12:57 -0700 Subject: [PATCH] add css_color definition to color theme schema --- schemas/color-theme/v1.json | 161 +++++++++++++++++++++--------------- 1 file changed, 93 insertions(+), 68 deletions(-) diff --git a/schemas/color-theme/v1.json b/schemas/color-theme/v1.json index 39e4d3d..deda7ac 100644 --- a/schemas/color-theme/v1.json +++ b/schemas/color-theme/v1.json @@ -12,210 +12,235 @@ "description": "Contains the values that will be used to populate the CSS variables controlling the UI theme", "properties": { "sun": { - "type": "string" + "$ref": "#/definitions/css_color" }, "moon": { - "type": "string" + "$ref": "#/definitions/css_color" }, "bg_main": { - "type": "string" + "$ref": "#/definitions/css_color" }, "bg_light": { - "type": "string" + "$ref": "#/definitions/css_color" }, "bg_heavy": { - "type": "string" + "$ref": "#/definitions/css_color" }, "bg_popup_mask": { - "type": "string" + "$ref": "#/definitions/css_color" }, "line": { - "type": "string" + "$ref": "#/definitions/css_color" }, "text_heading": { - "type": "string" + "$ref": "#/definitions/css_color" }, "text_body": { - "type": "string" + "$ref": "#/definitions/css_color" }, "text_light": { - "type": "string" + "$ref": "#/definitions/css_color" }, "text_link": { - "type": "string" + "$ref": "#/definitions/css_color" }, "text_link_active": { - "type": "string" + "$ref": "#/definitions/css_color" }, "text_link_visited": { - "type": "string" + "$ref": "#/definitions/css_color" }, "text_highlight": { - "type": "string" + "$ref": "#/definitions/css_color" }, "bg_text_highlight": { - "type": "string" + "$ref": "#/definitions/css_color" }, "text_selection": { - "type": "string" + "$ref": "#/definitions/css_color" }, "bg_text_selection": { - "type": "string" + "$ref": "#/definitions/css_color" }, "bg_button_primary": { - "type": "string" + "$ref": "#/definitions/css_color" }, "bg_button_primary_hover": { - "type": "string" + "$ref": "#/definitions/css_color" }, "text_button_primary": { - "type": "string" + "$ref": "#/definitions/css_color" }, "bg_button_secondary": { - "type": "string" + "$ref": "#/definitions/css_color" }, "bg_button_secondary_hover": { - "type": "string" + "$ref": "#/definitions/css_color" }, "text_button_secondary": { - "type": "string" + "$ref": "#/definitions/css_color" }, "bg_error_box": { - "type": "string" + "$ref": "#/definitions/css_color" }, "border_error_box": { - "type": "string" + "$ref": "#/definitions/css_color" }, "text_error_box": { - "type": "string" + "$ref": "#/definitions/css_color" }, "bg_input": { - "type": "string" + "$ref": "#/definitions/css_color" }, "border_input": { - "type": "string" + "$ref": "#/definitions/css_color" }, "border_input_invalid": { - "type": "string" + "$ref": "#/definitions/css_color" }, "icon_active_indicator": { - "type": "string" + "$ref": "#/definitions/css_color" }, "icon_success_indicator": { - "type": "string" + "$ref": "#/definitions/css_color" }, "icon_failure_indicator": { - "type": "string" + "$ref": "#/definitions/css_color" }, "icon_warning_indicator": { - "type": "string" + "$ref": "#/definitions/css_color" }, "chart_axis": { - "type": "string" + "$ref": "#/definitions/css_color" }, "chart_text": { - "type": "string" + "$ref": "#/definitions/css_color" }, "chart_guideline": { - "type": "string" + "$ref": "#/definitions/css_color" }, "chart_data_0": { - "type": "string" + "$ref": "#/definitions/css_color" }, "chart_data_1": { - "type": "string" + "$ref": "#/definitions/css_color" }, "chart_data_2": { - "type": "string" + "$ref": "#/definitions/css_color" }, "chart_data_3": { - "type": "string" + "$ref": "#/definitions/css_color" }, "chart_data_4": { - "type": "string" + "$ref": "#/definitions/css_color" }, "chart_data_5": { - "type": "string" + "$ref": "#/definitions/css_color" }, "chart_data_6": { - "type": "string" + "$ref": "#/definitions/css_color" }, "chart_data_7": { - "type": "string" + "$ref": "#/definitions/css_color" }, "chart_data_8": { - "type": "string" + "$ref": "#/definitions/css_color" }, "chart_data_9": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_normal": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_shadow": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_background": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_selection": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_comment": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_punc": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_operator": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_const_literal": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_number_literal": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_boolean_literal": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_tag": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_string": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_keyword": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_func_name": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_class_name": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_regex_important": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_variable": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_builtin": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_attr_name": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_gutter_divider": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_line_number": { - "type": "string" + "$ref": "#/definitions/css_color" }, "code_line_highlight": { - "type": "string" + "$ref": "#/definitions/css_color" } } } + }, + "definitions": { + "css_color": { + "description": "A valid CSS color value (see https://developer.mozilla.org/en-US/docs/Web/CSS/color_value)", + "oneOf": [ + { + "type": "string", + "format": "regex", + "pattern": "^(#[0-9a-fA-F]{3}(?:[0-9a-fA-F]{3}(?:[0-9a-fA-F]{2})?)?)$", + "examples": [ "#000", "#ff0000", "#ffccaa88" ] + }, + { + "type": "string", + "format": "regex", + "pattern": "^(rgb\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*\\))$", + "examples": [ "rgb(10, 70, 130)" ] + }, + { + "type": "string", + "format": "regex", + "pattern": "^(rgba\\(\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([0-9]{1,3})\\s*,\\s*([01]|[01]?\\.[0-9]{1,3})\\s*\\))$", + "examples": [ "rgba(10, 70, 130, 0.5)" ] + } + ] + } } } \ No newline at end of file