Set class to an input with twig Hello i am working on theming for Drupal 8 using twig 
My question is :
I want to assign css class to each input swicth the type of the input
exemple &lt;input type='email' class='email_cls'&gt; 

&lt;input type='submit' class='submit_cls'&gt;


what code should i use ,knowing that i use the default template twig file input.html.twig  I did this 

&lt;input{{ attributes.addClass('submit_cls email_cls') }} /&gt;{{ children }}


The problem is on my form both of the inputs email &amp; submit have the same display
You could use this in your theme:

function template_preprocess_input(&amp;$variables) {
  $variables['attributes']['class'][] = 'your_class';
}


and maybe even check the type like:

function template_preprocess_input(&amp;$variables) {
  if ($variables['attributes']['type'] == 'email') {
    $variables['attributes']['class'][] = 'your_class_email';
  }
}