How to add class to all input elements Drupal8?

Drupal 8 Preprocess theme variables for a specific theme hook.
  function hook_preprocess_HOOK(&$variables) {
    $variables['attributes']['class'][] = 'my-class';
  }

  or using template_preprocess_form_element().
  '#attributes' => array('class' => array('firstclass', 'secondclass')),

  Drupal 7
  The form tag $form['#attributes']['class'][] = 'my-class';
  The form submit button $form['submit']['#attributes']['class'][] = 'my-class';
  Form elements  $form['user_login_form']['#attributes']['class'][] = 'custom-class';
 

Tags

Instagram Without API

Could not reach Instagram server