Skip to content

Commit bfbbf0a

Browse files
fix: Allow dynamic style via repeater
closes: #247
1 parent db960aa commit bfbbf0a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

builder/builder/doctype/builder_page/builder_page.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,9 +582,12 @@ def set_dynamic_content_placeholder(block, data_key=False):
582582
_property
583583
] = f"{{{{ {key} or '{escape_single_quotes(block['attributes'].get(_property, ''))}' }}}}"
584584
elif _type == "style":
585-
block["baseStyles"][
586-
_property
587-
] = f"{{{{ {key} or '{escape_single_quotes(block['baseStyles'].get(_property, ''))}' }}}}"
585+
if not block["attributes"].get("style"):
586+
block["attributes"]["style"] = ""
587+
css_property = camel_case_to_kebab_case(_property)
588+
block["attributes"][
589+
"style"
590+
] += f"{css_property}: {{{{ {key} or '{escape_single_quotes(block['baseStyles'].get(_property, '') or '')}' }}}};"
588591
elif _type == "key" and not block.get("isRepeaterBlock"):
589592
block[_property] = f"{{{{ {key} or '{escape_single_quotes(block.get(_property, ''))}' }}}}"
590593

0 commit comments

Comments
 (0)