title: Twig Append Content to Block
body: <p>In twig templating, is it possible to append content to a block?</p>
  
  <p>For example, consider the template files below.</p>
  
  <p>layout.html.twig</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;style&gt;
      {% block css %}{% endblock css %}
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  {% block content %}{% endblock content %}
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>inner.html.twig</p>
  
  <pre><code>{% block css %} 
  a { color: #fff; }
  body { background: #f00; }
  {% endblock css %}
  
  {% block content %}
  
  Some contents here...
  {% include 'myWidget.html.twig' %}
  
  {% endblock content %}
  </code></pre>
  
  <p>myWidget.html.twig</p>
  
  <pre><code>{% block css %}
  div a { color: #777; }
  {% endblock css %}
  {% block content %}
  &lt;div&gt;&lt;a&gt;myWidget content here...&lt;/a&gt;&lt;/div&gt;
  {% endblock content %}
  </code></pre>
  
  <p>Notice the block css.. What I am trying to accomplish is that I want to have each content of the block css appended to the layout.html.twig's css block. Thus, the end result should be:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;style&gt;
      a { color: #fff; }
      body { background: #f00; }
      div a { color: #777; }
      &lt;/style&gt;
  &lt;/head&gt;
  &lt;body&gt;
  Some contents here...
  &lt;div&gt;&lt;a&gt;myWidget content here...&lt;/a&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>