Twig overriding parent variables I want to override the block.html.twig 'classes' variable in my block--system-branding-block.html.twig which extends block.html.twig. I tried to set the 'classes' inside block--system-branding-block.html but this didn't work.

block.html.twig

{%
 set classes = [
  'block',
  'block-' ~ configuration.provider|clean_class,
  'block-' ~ plugin_id|clean_class,
]
%}
&lt;div{{ attributes.addClass(classes) }}&gt;
 {{ title_prefix }}
 {% if label %}
   &lt;h2{{ title_attributes }}&gt;{{ label }}&lt;/h2&gt;
 {% endif %}
 {{ title_suffix }}
 {% block content %}
   {{ content }}
 {% endblock %}
&lt;/div&gt;


block--system-branding-block.html.twig

{% extends "block.html.twig" %}

{% block content %}
  {% if site_name %}
    &lt;div class="site-name"&gt;
     &lt;a href="{{ path('&lt;front&gt;') }}" title="{{ 'Home'|t }}" rel="home"&gt;{{ site_name }}&lt;/a&gt;
   &lt;/div&gt;
  {% endif %}
  {% if site_slogan %}
   &lt;div class="site-slogan"&gt;{{ site_slogan }}&lt;/div&gt;
  {% endif %}
{% endblock %}


I want to put another entry in the classes variable just for the block--system-branding-block.html.twig witch extends the block.html.twig
It's not quite the approach you had in mind (modifying the classes variable) but I would recommend you do as Bartik does and work with the Attribute object instead:

{% extends "block.html.twig" %}

{% set attributes = attributes.addClass('new-class-goes-here') %}

{% block content %}
  {% if site_name %}
    &lt;div class="site-name"&gt;
     &lt;a href="{{ path('&lt;front&gt;') }}" title="{{ 'Home'|t }}" rel="home"&gt;{{ site_name }}&lt;/a&gt;
   &lt;/div&gt;
  {% endif %}
  {% if site_slogan %}
   &lt;div class="site-slogan"&gt;{{ site_slogan }}&lt;/div&gt;
  {% endif %}
{% endblock %}


I think the key thing here is that the variable you are modifying is initialized (and used) outside of the twig block. If the variable were initialized inside the twig block then I can see needing to override it inside the child templates's twig block as well.

More on working with Attributes in templates here: https://www.drupal.org/node/2513632