For many attorneys, there is very little concern that a judge will comment on your attire, hair, or overall style. However, it does happen, and unfortunately, more often than not, it will happen behind your back.
When it does happen that a judge calls out a lawyer in their courtroom for some perceived fashion faux paus, an attorney may feel compelled to defend their dressing decisions, but that might not be the right choice. After all, it's the client's case, and if a judge is going to be distracted by an attorney's clothing to the point of commenting, that attorney may want to listen and dress to the judge's expectations, simply to not prejudice their client.
Is Fashion Really Your Hill?
While fashion may be really important to some lawyers, when a judge makes comments about fashion choices, getting defensive probably isn't the right choice. While the judge may be out of line, that's probably not something an attorney should devote energy or time to arguing about during their client's case. An attorney's individualized fashion is not more important than a client's case, at least in terms of professional responsibility.
If a judge gives you fashion advice, whether it is good or bad (just so long as it's not gross, or unreasonable, a la the now infamous Judge Kopf) thank them as genuinely as possible, and follow it the next time you appear in their court. Think of it as an easy way to make the judge happy, like using high quality paper for a "chamber's copy," or some other "simple courtesy" you do to subtly kiss the bench's backside.
What About Inappropriate Comments?
While you may want to fire back at the judge that the 1980s called asking for help on quaffing their comb-over just right, you probably (most definitely) shouldn't. Rather, consider filing a formal complaint with the judicial council, and attach transcripts, or declarations, to substantiate your complaint.
Simply put, judges should not be making inappropriate comments. While it may seem petty to some to file a complaint over an offhand remark, to many others, it's heroic. After your case has concluded, and there's no chance of an appeal being remanded back to that same judge thereby putting your client in peril, your complaint could be what ends up correcting the conduct (or it could just be one of many that puts the judicial council on sufficient notice of a judge's pattern of misconduct).