I am using the below code for setting responsive background Image dynamically, but it's not working in my component. Image is not showing and my UI is also disturbed.
Please suggest the right code for my component to add a background image dynamically.
<sly data-sly-set.backgroundImage="--backgroundImage:url('${model.backgroundImg}');"
data-sly-set.backgroundImageSmall="--backgroundImageSmall:url('${model.backgroundImgSmall}');"
data-sly-set.backgroundColor="background-color: ${model.backgroundColor}"
data-sly-set.backgroundImageStyle="${model.backgroundImg ? backgroundImage : '' };${model.backgroundImgSmall ? backgroundImageSmall : '' };${properties.backgroundLayout};${model.backgroundColor ? backgroundColor : '' }"></sly>
<div class="superteaser-grid ${model.gridStyle}" style="--backgroundImage:${backgroundImageStyle @ context='unsafe'}; ">