Mark - textColor

Purpose

The textColor mark is intended to be applied to text nodes to indicate <style="color: red">colour styling.

Example

1
2
3
4
5
6
7
8
9
10
11
12
{
  "type": "text",
  "text": "Hello world",
  "marks": [
    {
      "type": "textColor",
      "attrs": {
        "color": "#97a0af"
      }
    }
  ]
}

Combination with other marks

textColor can NOT be combined with the following marks:

Fields

NameMandatoryTypeValueNotes
typestring"textColor"
attrsobject
attrs.colorstringString matching "^#0-9a-f{6}$" regular expression