diff --git a/agaric/templates/paragraph/paragraph--title.html.twig b/agaric/templates/paragraph/paragraph--title.html.twig index e02cdbf..bb7c68b 100644 --- a/agaric/templates/paragraph/paragraph--title.html.twig +++ b/agaric/templates/paragraph/paragraph--title.html.twig @@ -38,6 +38,7 @@ * @ingroup themeable */ #} +{% set attributes = attributes.setAttribute('data-headerbg', 'transparent') %} {% set classes = [ 'hero', @@ -46,6 +47,9 @@ %} {% if paragraph.field_style_color is not empty %} {% set classes = classes|merge(['is-'~paragraph.field_style_color.value]) %} + {% if paragraph.field_style_color.value == 'white' %} + {% set attributes = attributes.removeAttribute('data-headerbg') %} + {% endif %} {% endif %} {% if paragraph.field_style_titlebar.value == false %} {% set classes = classes|merge(['hero-project']) %} @@ -58,12 +62,13 @@ {% set classes = classes|merge(styles) %} {% endif %} + {% if paragraph.field_style_titlebar.value == true and paragraph.field_image is not empty %} - {% set attributes = attributes.setAttribute('data-headerbg', 'transparent').setAttribute('style', 'background-image: url('~file_url(paragraph.field_image.entity.uri.value)~')') %} + {% set attributes = attributes.setAttribute('style', 'background-image: url('~file_url(paragraph.field_image.entity.uri.value)~')') %} {% endif %} {% block paragraph %} - + {% block content %} {% if paragraph.field_style_titlebar.value == false %}