Style json

A note of caution: It is not recommended to use this style extensively because it is rather hard to debug.

The style json allows to specify nested base styles as a JSON string.

There are a few things to note:

  • the key _baseStyle must be used to indicate that the assigned object is a style object
  • the style object must contain the key _name where the value must match a style name
  • the style object must contain the key _fields where the value is an object holding all required fields of the style (refer to the style documentation for more information)

For example, the following syntax allows to define a alert style wrapping a markdown style:

{
    "_baseStyle": {
        "_name": "alert",
        "_fields": {
            "type": "success",
            "is_dismissable": true,
            "children": [{
                "_baseStyle": {
                    "_name": "markdownInline",
                    "_fields": {
                        "text_md_inline": "This is **bold**"
                    }
                }
            }]
        }
    }
}

Unknown Style styleSignature

An Example

The following was created by using the style json and the code described above.

This is bold