This is a followup to #3301853: Create twig filters: |add_class and |set_attribute.

In that issue we wanted to add the |remove_class along with the other filters. However, we determined it does not work as expected when the template adds the CSS class (e.g. the field class).

As a front-end developer, I would expect that the |remove_class would remove those CSS classes, however it currently cannot.

We're not sure this is fixable (or even should be fixed). But if so, we can work on ithere.

Comments

mherchel created an issue. See original summary.

Version: 10.1.x-dev » 11.x-dev

Drupal core is moving towards using a “main” branch. As an interim step, a new 11.x branch has been opened, as Drupal.org infrastructure cannot currently fully support a branch named main. New developments and disruptive changes should now be targeted for the 11.x branch, which currently accepts only minor-version allowed changes. For more information, see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

Version: 11.x-dev » main

Drupal core is now using the main branch as the primary development branch. New developments and disruptive changes should now be targeted to the main branch.

Read more in the announcement.