Skip to content

Commit

Permalink
fix: Allow dynamic style via repeater
Browse files Browse the repository at this point in the history
closes: #247
  • Loading branch information
surajshetty3416 committed Nov 10, 2024
1 parent db960aa commit bfbbf0a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions builder/builder/doctype/builder_page/builder_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -582,9 +582,12 @@ def set_dynamic_content_placeholder(block, data_key=False):
_property
] = f"{{{{ {key} or '{escape_single_quotes(block['attributes'].get(_property, ''))}' }}}}"
elif _type == "style":
block["baseStyles"][
_property
] = f"{{{{ {key} or '{escape_single_quotes(block['baseStyles'].get(_property, ''))}' }}}}"
if not block["attributes"].get("style"):
block["attributes"]["style"] = ""
css_property = camel_case_to_kebab_case(_property)
block["attributes"][
"style"
] += f"{css_property}: {{{{ {key} or '{escape_single_quotes(block['baseStyles'].get(_property, '') or '')}' }}}};"
elif _type == "key" and not block.get("isRepeaterBlock"):
block[_property] = f"{{{{ {key} or '{escape_single_quotes(block.get(_property, ''))}' }}}}"

Expand Down

0 comments on commit bfbbf0a

Please sign in to comment.