Add a class the the form element (tag) of the search block form
you can use the prefix and suffix tag
like

$variables['element']= ['#prefix' =&gt; '&lt;div class ="abc"&gt;',
                        '#suffix' =&gt; '&lt;/div&gt;']