Skip to content

Commit d7ec0e4

Browse files
update fixture and add ref for conditional setting (#999)
### TL;DR Added conditional visibility support to paragraph settings in theme schema. ### What changed? - Extended the paragraph setting schema to include the `conditionalSetting` reference, allowing paragraph elements to use the `visible_if` property - Updated the test fixture to include an example of a paragraph with conditional visibility based on a checkbox state ### How to test? fixture passing: ![Screenshot 2025-07-09 at 12.13.51 PM.png](https://graphite-user-uploaded-assets-prod.s3.amazonaws.com/vIaAqbh3Um5IJRCLPJa3/67abca7e-011d-4d20-bb59-a6d574ee4675.png) ### Why make this change? make visible_if a valid property on paragraph
2 parents 86534e9 + d89fcaa commit d7ec0e4

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

schemas/theme/setting.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1126,7 +1126,10 @@
11261126
},
11271127

11281128
"paragraph": {
1129-
"allOf": [{ "$ref": "#/definitions/sidebarStandardSettings" }],
1129+
"allOf": [
1130+
{ "$ref": "#/definitions/sidebarStandardSettings" },
1131+
{ "$ref": "#/definitions/conditionalSetting" }
1132+
],
11301133
"properties": {
11311134
"type": {
11321135
"const": "paragraph",

tests/fixtures/section-schema-conditional-settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@
77
"visible_if": "{{ section.settings.show_advanced }}",
88
"info": "Configure advanced options below"
99
},
10+
{
11+
"type": "paragraph",
12+
"content": "This paragraph provides additional context and instructions for the advanced settings section.",
13+
"visible_if": "{{ section.settings.show_advanced }}"
14+
},
1015
{
1116
"type": "checkbox",
1217
"id": "enable_features",
@@ -137,4 +142,4 @@
137142
"visible_if": "{{ section.settings.media_type == 'video' }}"
138143
}
139144
]
140-
}
145+
}

0 commit comments

Comments
 (0)