It is makrooh and undesired to seek Islamic knowledge from such a preacher or teacher who trims beard or keeps it less than one fist or does not cover his head and wears fashionable clothes. As the religious sciences does not only aim at knowledge rather their key purpose is firmness in practice and belief. Thus if the teacher does not keep Shariah appearance and tends towards fashionable things then it might affect the students. Hence one must learn the knowledge of religion and Shariah from practicing Muslim. Muhammad Ibn Seereen, Allah have mercy upon him, writes in Muqaddama Muslim Sharif (p 11):
إن هذا العلم دين فانظرو ا عمن تأخذون دينكم.
Allah knows Best!
Darul Uloom Deoband