Dress codes are not inherently illegal. If your boss decides to institute one in your workplace, you may not approve of the decision, but it’s not necessarily a violation of your rights. Many companies do have dress codes. In some situations, it’s a simple guideline to follow, though some companies will give employees uniforms to wear.
That being said, it is possible for a dress code to violate your rights and be illegal. One way for this to happen is if it is discriminatory in nature. It has to apply evenly to all workers or it could violate the rights of some of those workers.
How would it be uneven?
You essentially just need to consider if the dress code impacts people in a protected class in a different way than it impacts other employees.
For example, it would be a clear violation if a company had a dress code saying that women all needed to wear a very specific outfit and that men could wear whatever they wanted. The dress code only impacts female employees, so it is a type of gender-based discrimination.
But there can be more subtle cases. For example, maybe someone is part of a certain religion and they have different items that they wear as they observe that religion. A dress code that simply prohibits wearing those items may technically apply to all employees, but it would still be discriminatory because it is clearly focused on that religion.
What options do you have?
Do you believe you are facing discrimination at work? If so, take the time to look into all of your legal options. It can help to have an experienced legal team at your side.