Twig find if a css class exists in a tag Is there a way to find out if a css class exists in a specific tag through twig?
For example:
&lt;body class=&quot;new-class&quot;&gt;

Then I'm able to do a conditional statement in twig based if new-class exists.
Is this possible?
You could use hasClass to find the CSS class in a specific tag
eg. {% if body.attributes.hasClass('new-class') %}