Easy way to alternate something (classes for example) every X and X times in Twig
{# Example: 2/6/2/6/2/6... #}
{# first batch + second batch sum #}
{% for batch in posts|batch(8) %}
{% for item in batch %}
{% set size = 'class-A' %}
{# first batch + 1 #}
{% if loop.index < 3 %}
{% set size = 'class-B' %}
{% endif %}
{% include 'partials/teaser-partial.twig' with {'post':item, 'size':size} %}
{% endfor %}
{% endfor %}