- πΊπΈUnited States smustgrave
Is your twig template adding the extra div?
- πΊπΈUnited States maskedjellybean Portland, OR
I'm not sure whether this is a bug or task. I only know it doesn't seem right. Having the additional nested block classes will cause unexpected styling issues.
This has been a problem on every Drupal 8+ project I've worked on regardless of theme.
- πΊπΈUnited States mark_fullmer Tucson
The problem is that if you follow that documentation, you end up with unnecessary nested block templates.
I think this depends on what your block.html.twig file is doing. For example, Olivero's template renders the additional divs:
<div{{ attributes.addClass(classes) }}> {{ title_prefix }} {% if label %} <h2{{ title_attributes.addClass('block__title') }}>{{ label }}</h2> {% endif %} {{ title_suffix }} {% block content %} <div{{ content_attributes.addClass('block__content') }}> {{ content }} </div> {% endblock %} </div>
...whereas Stable9, for example, does not:
<div{{ attributes }}> {{ title_prefix }} {% if label %} <h2{{ title_attributes }}>{{ label }}</h2> {% endif %} {{ title_suffix }} {% block content %} {{ content }} {% endblock %} </div>
If a site is defining a custom block plugin, I think it would be reasonable to "solve" this issue by customizing a block-level template, either site-wide, or for a subset of blocks, which can be done through Twig template suggestions.
I think this issue is "works as designed."