Why can't I output the style tag in my twig template? I'm desperately trying to render a style attribute, inside a paragraph's template. But all of these variations:

{%
  set backgroundUrl = content.field_slider_background|render|naked|replace({' ': '', "\\n": '', "\\r": ''})
%}


&lt;div class="wrapper"&gt;
  &lt;div class="background-item" style="background-image: url({{ backgroundUrl }});"&gt;


,

{%
  set backgroundAttributes = create_attribute()
%}

&lt;div{{ backgroundAttributes.addClass('background-item').setAttribute('style', 'background-image: url(' ~ backgroundUrl ~ ')') }}&gt;


and even:

&lt;div class="background-item" style="z-index: 0;"&gt;

and 

&lt;div class="background-item" {{ 'style="...' }}&gt;

just return &lt;div class="background-item"&gt;. Other tags are fine.

Does twig generally strip style tags?! Using the latest D8 version...

Edit: outputting backgroundUrl actually gives me the correct string, so writing a tag like data-test="{{ backgroundUrl }}" works nicely
I've done it to print a background color like this in a paragraph template

&lt;div class="container color-{{ content.field_text_color[0] }}" style="background: #{{ content.field_card_color[0] }};"&gt;


And it just worked fine. Can you give us the full template maybe we can figure out why it doesn't work.