Considering what TMs at my store get away with when it comes to not complying with dress code, leggings might not raise many TL or ETL eyebrows but it definitely would with some TMs. Depends who you work with maybe.
I'm more the old school khaki and red or burgundy shirt type, but I've seen so many things not even close to "khakis or jeans & red shirt" dress code that I'm not sure my store really has much of a dress code anymore. (Although now that I think about it, there was a cashier who was really pretty far out there with her make-up and jewelry choices in addition to her clothing and she hasn't been around the last few weeks. It was remotely okay for Halloween, but she kept it going way beyond that. Some little kids were overheard making comments that she was kind of scary-looking. And she was to some adults too.)
If you've specifically been told to not wear leggings, then it seems like a good idea not to. To do otherwise is akin to flipping off whoever told you that.