That would be true if uniform were pronounced as "ooniform". I'm not sure what dialect of English you have, but most of them pronounce it as "yooniform". Y, notably, being a consonant here.
It's why why someone would say "Could you spare a Euro? and not "Could you spare an Euro?"
Or someone would say "I visited a university yesterday" rather than "I visited an university yesterday."
It's not the WRITTEN word but the SOUND. You need to be careful with the words starting with U because it can be pronounced either /a/ or /ju/, and H because it may be silent sometimes.
A universe, uniform, etc...
AN umbrella, umpire, etc...
A hospital, house, etc...
AN hour, heir, etc...
Maybe someone that actually studies languages for a living can correct me, but as far as i know, vowels are considered vowels if you don't use your tongue or your lips does not touch each other to pronounce the lettter. As in "e" and "i" pronounced in english, you use only your "throat air" and the opening size of your mouth. Same is in portuguese and i believe it should be in every other language. (Test this yourselves) That said, why "y" is not considered a vowel? With that questioning, "yoo" would still sound like a vowel, in "yoo-ni-form", and it should have the "an" preposition, by rule.
Not a linguist but I think it's cuz you still constrict your mouth a bit to say 'y' compared to 'ee' where you don't. It's not lips or tongue but more like the back of the mouth. Similarly to a 'hh' sound - no lips or tongue used but definitely a consonant. Also if you tried to say 'an yooniform' vs 'a yooniform' you'll probably find the latter easier to say :)
there are some answers to the question about the use a and an before the begining words with vowel! but it is not clear for me, could some friend help me with this. i will apreciate your answer and i I want to take this opportunity to wish you a happy ending of the year and a successful new year 2017