Theme Layers JSON API

Introduction

The JSON API allows developers to define Gravity Forms styles using theme.json. By adding a gravityforms section to the file, you can easily configure various styling options for forms directly in JSON.

When the theme.json is parsed, the system will grab its defined values and use them for the Theme Layer. This allows a much more streamlined process for registering a Theme Layer without the need for any actual coding.

Usage

{
    "version": 2,
    "settings": {
    "appearanceTools": false,
    ...more theme-related settings,
    "gravityforms": {
        "settings": [
            {
                "name": "enable",
                "label": "Enable Conversational Forms",
                "type": "toggle",
            },
            ...more settings fields,
        ],
        "styles": [
            {
                "name": "conversational_forms_styles",
                "url": "https://gravity.local/assets/css/conversational/styles.css",
                "condition": {
                    "source": "enable",
                    "value": true,
                }
            },
            ...more styles
        ]
    }