How to add class to a Twig template - Drupal

By manoj , 1 November, 2022

To add  classes just  create an array of classes

 use the set keyword in front of name of the array like this 

{%
  set classes = [
    'content',
    'clearfix',
  ]
%}

And pass array to the attributes.addClass() function.